Jump to content

Redirect Dynamic Pages i.e. /index.php?id=45 to /page/45


Recommended Posts

Yes, I keep searching everywhere here on this forum and all over the net but I can't seem to get this code to work:

 

RewriteRule ^/calendar/detail\.php?id=([0-9]+)$ /course/$1  [NC,L]

 

I need www.domain.com/calendar/detail.php?id=80 to redirect to www.domain.com/course/80.  In the future, more of those "id's" will be changed to words in the database to improve SEO (for instance: id?=this-is-the-course-title).  But all I want is something like /course/this-is-the-course-title/, not /calendar/detail.php?id=this-is-the-course-title/.

 

So, how can I get that dynamic page to display the static page AND redirect old pages (i.e. calendar/detail.php?id=80) to their new locations (i.e. course/this-is-the-new-course-title/)?

 

Greatly appreciate the help as I'm been at this for many hours.  :-\

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.