简体   繁体   中英

.htaccess redirect except one folder

I have an .htaccess file that looks like this:

RewriteBase /
RewriteCond %{REMOTE_HOST} !^141.134.66.211
RewriteRule .* http://www.sw-webdesign.be/construction.php [R=302,L]

This file redirects the entire site (except 141.134.66.211). My problem is that I have a folder on my webserver (/admin) that shouldn't be redirected. So when someone goes to /admin/index.php he shouldn't be redirected. Does anyone know how I can do this?

All help is welcome! Thanks

There are so many ways to do it. If this one is NOT what you want. You need to provide me more information. Especially the sample urls with the outputs you expect.

RewriteBase /
RewriteCond %{REQUEST_URI} !^/admin/.*
RewriteCond %{REMOTE_HOST} !^141.134.66.211
RewriteRule (.*) http://www.sw-webdesign.be/construction.php [R=302,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM