FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

htaccess 301 redirect for dynamic URLs

Feed 2 posts, 2 voices

Avatar
96 posts

I want to redirect some old URLs to their new location but having problems doing this for dynamic URLs.

The following format works for static URLs:

[code]RewriteRule ^commercial_services.php /services-for-business [R=301,L][/code]

I suspect the format for dynamic URLs (e.g. http://www.domain.com/commercial_services.php?s=1&t=0) is something like:

[code]
RewriteCond %{QUERY_STRING} ^s=1&t=0$
RewriteRule ^/commercial_services.php$ /services-for-business/company-commercial [R=301,L]
[/code]

I’ve tried dozens of variations but no luck. Any suggestions please?

 
Avatar
1 posts

I’m not a pro at this but i think you are missing a \ and have an extra /
RewriteRule ^/commercial_services.php$ to RewriteRule ^commercial_services\.php$

PS: sorry for my bad English :( , also I’m not really shore what you want to do

this would redirect page to /services-for-business/company-commercial, i would recommend to search for DLE htaccess and looking for examples there :)

 
Avatar
96 posts

Thanks, I found a solution – details at http://www.wolfcms.org/forum/post262.html