开发者

.htaccess redirect anywhere except a specific directory

开发者 https://www.devze.com 2023-04-03 04:30 出处:网络
I\'d like to edit .htaccess so that it would display a redirect to my /ma开发者_C百科in/ directory when I visit a page that is not in the /main/ directory. How would I go on about doing this?I think:

I'd like to edit .htaccess so that it would display a redirect to my /ma开发者_C百科in/ directory when I visit a page that is not in the /main/ directory. How would I go on about doing this?


I think:

RewriteCond %{REQUEST_FILENAME} !^main/.*
RewriteRule ^(.*)$ redirect_file.php [L]

would do it

0

精彩评论

暂无评论...
验证码 换一张
取 消