Forum Moderators: phranque

Message Too Old, No Replies

Rewrite with Directories

         

jhaski

2:43 am on Jul 9, 2009 (gmt 0)

10+ Year Member



I am trying to redirect a view from [mysite.com...] to [mysite.com...]

I can't figure out what is wrong with this statement in my .htaccess file

# Externally redirect client requests for old dynamic URLs to equivalent new static URLs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /Books-Software/([^&]+)/\ HTTP/
RewriteRule ^/Books-Software/$ [mysite.com...] [R=301,L]

jdMorgan

3:39 am on Jul 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Remove the leading slash from the RewriteRule pattern for use in .htaccess.

Also, your RewriteCond will match faster if you change the pattern to

^[A-Z]{3,9}\ /Books-Software/([b][^/]+[/b])/\ HTTP/

so that the matching engine can stop processing the parenthesized sub-pattern as soon as it finds the slash after "pID".

Jim

g1smd

8:01 pm on Jul 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Edit the comment to remove the reference to "dynamic" URLs.

I'm guessing the code was copied from elsewhere and modified.