Domanda

I have made some changes on my website structure and would like to use a perm redirect using .haccess

The old URL's:

http://domain.com/search/
http://domain.com/browse/

New URLS:

http://domain.com/search/searchevents/
http://domain.com/browse/eventlist

Have tried a few suggestions from other posts- but i have ended up with some loops going on!

Thanks for taking the time to read.

Jamie.

È stato utile?

Soluzione

Try:

RedirectMatch 301 ^/search/(.*)$ /search/searchevents/$1
RedirectMatch 301 ^/browse/(.*)$ /search/eventlist/$1

If you have rewrite rules, you should probably not use mod_alias (the RedirectMatch) and stick with mod_rewrite:

RewriteEngine On
RewriteRule ^search/(.*)$ /search/searchevents/$1 [L,R=301]
RewriteRule ^browse/(.*)$ /search/eventlist/$1 [L,R=301]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top