1

I'm in the process of migrating a blog to a new platform & server, and having trouble with mod_rewrite .htaccess rules. So far I'm able to redirect post URLs and the root domain the the new server, but the rules for the RSS URL is being ignored.

Here are my rules:

RewriteRule ^[0-9]+/[0-9]+/([^/]+)/?$ http://blog.example.com/$1 [R=302,L] #working
RewriteRule ^/rss$ http://blog.example.com/rss [R=302,L] #not working
RewriteRule ^$ http://blog.example.com/ [R=302,L] #working

The first and last rule are working as expected, but the second rule is not redirecting. If I type in http://example.com/rss it does not redirect to http://blog.example.com/rss

I feel like I'm missing something simple. This is my first time fiddling with mod_rewrite. Thanks.

1 Answer 1

1

Assuming that you're using apache 2.0+, you need to remove the leading slash from the patterns because they get stripped by apache when rules in an htaccess file are being applied.

RewriteRule ^rss$ http://blog.example.com/rss [R=302,L] 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.