문제

so i have a website. i created a mirror of it and uploaded it in a directory called 'mirror' what i wanted to do is whenever a viewer access for example..

http://www.mysite.com/this-page/another-segment/?id=1

i want him to be redirected to..

http://www.mysite.com/mirror/this-page/another-segment/?id=1

i want to edit my site's design but i dont want viewers to get confused of random changes in the website design.

if there is another way other than using htaccess please do suggest it thank you

도움이 되었습니까?

해결책

after browsing around the internet. i came up with the idea of putting a /$1, a rewritebase and followsymlinks on the answer givien by appclay

Options +FollowSymLinks
RewriteEngine On 
RewriteBase /
RewriteCond %{REQUEST_URI} !^/mirror/
RewriteRule (.*) /mirror/$1 [R=301,L]

다른 팁

You'll want to do something like:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/mirror/
RewriteRule ^/(.*) /mirror/$1 [R]

In your .htaccess file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top