Forum Moderators: phranque
Thanks,
Jim
Redirect 301 /vb http://example.com/forums
I want to do the same while my links are dynamic,
Redirect 301 /file.php?id=$1 ^file/([^/]*)\.html$
But it doesn't work. is 301 the right option?
Thanks.
[edited by: jdMorgan at 11:38 pm (utc) on June 26, 2007]
[edit reason] example.com [/edit]
Since this is not a search-engine-friendly URL problem, then assuming that you have other working RewriteRules, the following will redirect dynamic URLs to their static equivalents:
RewriteCond %{QUERY_STRING} ^id=([^&]+)
RewriteRule ^file\.php$ http://www.example.com/file/$1.html [R=301,L]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=([^&]+)
RewriteRule ^file\.php$ http://www.example.org/file/%1.html? [R=301,L]
RewriteRule ^file/([^/]*)\.html$ /file.php?id=$1 [L]
The URL looks as it should in the address bar,
but I get this error in the browser,
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
If I remove the last line of the code, I'll get error 404.
Thanks.
[edited by: jdMorgan at 11:37 pm (utc) on June 26, 2007]
[edit reason] example.com, example.org [/edit]
The link to the solution was given in the thread cited above. But here it is again: Changing Dynamic URLs to Static URLs [webmasterworld.com]
Jim