Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6373383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:21:27+00:00 2026-05-25T01:21:27+00:00

I am working with mod_rewrite for the first time. I am going to present

  • 0

I am working with mod_rewrite for the first time.
I am going to present a scenario. Just let me know whether it’s possible or not.

suppose I have a database table with three attributes table(id,title,parentid).

and my url to access the particular content looks like this:

example.com/content.php?id=some_value

Now, for some_value id , title is some_title. Is it possible that such that

example.com/some_title/

can be renamed to above url.OR

example.com/content.php?id=some_value&title=some_title

I may also have url such as :

example.com/content.php?id=some_value&title=some_title&parenttitle=parent_title

In which case entered url should be something like this:

example.com/parent_title/some_title/

If I haven’t made myself clear do let me know. Again this is my first attempt at mod_rewrite. So even a small information will be very helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:21:28+00:00Added an answer on May 25, 2026 at 1:21 am

    Here’s what you can put in your .htaccess file

      # /id - search an ID
      RewriteRule ^([0-9]+)(/?)$ /content.php?id=$1 [QSA,L]                                                                   
    
      # /title - search a title
      RewriteRule ^([a-z0-9\-\ ]+)$ /content.php?title=$1 [NC,QSA,L]                                                          
    
      # /parent/child - search parent and child
      RewriteRule ^([a-z\-\ ]+)/([a-z0-9\-\ ]+)$ /content.php?parent=$1&child=$2 [NC,QSA,L]                                   
    
      # /id/name - search id and title
      RewriteRule ^([0-9]+)/([a-z0-9\-\ ]+)$ /content.php?id=$1&child=$2 [NC,QSA,L]                                           
    
      # /search/some_title - search for a title
      RewriteRule ^search/([a-z0-9\-\ ]+)(/?)$ /search.php?q=$1 [NC,QSA,L]    
    

    etc…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have not having any luck getting my .htaccess with mod_rewrite working. Basically all
I have mod_rewrite working on most of my site. Right now I have a
I am working on building my first search-engine friendly CMS. I know that perhaps
Can someone tell me how can I have mod_rewrite working on subdomain? The htaccess
I was working on debugging an issue today related to mixing mod_proxy and mod_rewrite
I am working on a site maintainence. It uses mod_rewrite technique. But im new
Working on a project at the moment and we have to implement soft deletion
I have the following code and the only redirect that seems to be working
I'm working with mod_rewrite for Windows (via an ISAPI filter) and haven't yet seen
I am using .htaccess and mod_rewrite in my little PHP framework. It's working nicely,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.