Forum Moderators: phranque

Message Too Old, No Replies

Have 301 Redirect with same Url as rewrite ..

         

editordude

9:57 pm on Aug 23, 2005 (gmt 0)

10+ Year Member



Hey all, I am using this code:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /interviews
RewriteRule ^(.*)/$ index.php?title=$1

Now say I have this url: domain.com/interviews/example_url/

which I want to re-direct 301 to: domain.com/interviews/new_url/

----------------------

I've tried using:
redirect 301 /example_url/ [domain.com...]

But this only results in:

[domain.com...]
As its being affected by the top bit of code.

Any ideas of how I can do this?

editordude

8:34 am on Aug 24, 2005 (gmt 0)

10+ Year Member



Anyone able to help?

The reason why I'm wanting to redirect a url that is already part of the rewrite is because it's a url indexed in google and as the new link has been set, I want to rediect the old link.

Thanks

jdMorgan

9:28 pm on Aug 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The simple solution may be to use mod_rewrite to do both redirects, instead of using mod_rewrite for one and mod_alias for the other. If you use mod_rewrite for both, you can control the order and precedence of the rules, and add exclusions to them to keep them from interfering with each other.

Jim