Reply
mod_rewrite redirect question
Old 10-05-2007, 07:22 AM mod_rewrite redirect question
Galaxian's Avatar
Dingleberry!

Posts: 544
Name: Rich
Location: United Kingdom
I have noticed that users and search engine spiders are still going on the original un-mod_rewrite'd versions of my pages. Now to combat this my question is, is it possible to 301 redirect the original page to the new page with mod_rewrite without it screwing up the rewrite?
__________________
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
When You Register, These Ads Go Away!
     
Old 10-06-2007, 02:34 PM Re: mod_rewrite redirect question
chrishirst's Avatar
Super Moderator

Posts: 12,752
Location: Blackpool. UK
depends on how the rewrite is done

Do we get some example code? because there are so many ways to code the same thing in .htaccess any answers could send you down the wrong track.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-08-2007, 08:41 AM Re: mod_rewrite redirect question
Galaxian's Avatar
Dingleberry!

Posts: 544
Name: Rich
Location: United Kingdom
It's just your standard RewriteRule gallery.php?id=(.*) gallery-$1.html

Problem is the search engine still indexs both. I want to do a permanent redirect if possible
__________________
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 10-09-2007, 09:25 AM Re: mod_rewrite redirect question
chrishirst's Avatar
Super Moderator

Posts: 12,752
Location: Blackpool. UK
Code:
RewriteRule gallery.php?id=(.*) gallery-$1.html [R=301]
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-09-2007, 11:02 AM Re: mod_rewrite redirect question
Galaxian's Avatar
Dingleberry!

Posts: 544
Name: Rich
Location: United Kingdom
It seems that did not work. It redirected the rewritten pages to the original .php?id= pages.
__________________
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Reply     « Reply to mod_rewrite redirect question
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13720 seconds with 13 queries