Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

catch rule for old URLs
Welcome, Guest. Please login or register.
December 03, 2008, 11:29:01 PM
11306 Posts in 1249 Topics by 499 Members
Latest Member: haulaslemycle
Experts Round Table Network  |  Webservers  |  Apache  |  catch rule for old URLs « previous next »
Pages: [1]
Author Topic: catch rule for old URLs  (Read 498 times)
seandelaney
Mentor

Offline Offline

Posts: 119



WWW
« on: January 17, 2007, 10:21:58 AM »

My catches that I use for Google wont work with my current rules... :-(

Code:
RewriteEngine on
RewriteRule ^about\.php$ /about/         <- catches old URL request from Google Index
RewriteRule ^about(/)?$ about.php [nc]  <- current rule, shows "about.php" when URL is domain.com/about/

Error I get is: Internal Server Error

What im doing to mimic a request coming form Google is typing into my address bar the URL that Google has indexed:

http://www.domain.com/about.php

The 1st rule above should catch this old URL from Google and write it as http://www.domain.com/about/

Then i want to use my current rule to open about.php when URL like: http://www.domain.com/about/ is request...

Am I doing this the wrong way?
Logged

GrandSchtroumpf
Mentor

Offline Offline

Posts: 411



« Reply #1 on: January 17, 2007, 06:03:19 PM »

Looks like you are in an infinite loop.
I guess you should redirect the old url instead of rewriting, or google will see duplicate content:

RewriteRule ^about\.php$ /about/ [R]

It's been a while since i last explored the details of mod rewrite.  I simply rewrite all url to index.php and i use php to parse the request and serve the appropriate page/redirection/error.  This way i don't have to mess with that complicated syntax.
Logged
seandelaney
Mentor

Offline Offline

Posts: 119



WWW
« Reply #2 on: January 18, 2007, 01:05:12 AM »

OK Thank you...
Logged

Pages: [1]
« previous next »
    Jump to: