문제

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.

도움이 되었습니까?

해결책

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]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top