开发者

how to restrict website access to a couple of web pages and ip address only, using htaccess

Using following

Options +FollowSymlinks
RewriteEngine on

RewriteCond %{REQUEST_URI} !/temp_page.php$
RewriteCond %{REQUEST_URI} !/thanks.php$

RewriteCond %{REMOTE_HOST} !^90\.333\.222\.111
#RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1

RewriteRule $ /temp_page.php [R=302,L]

can allow myself (ip) to view all pages, and other get to view only temp_page and thanks.php. I've images and css files linked on temp_page and thanks.php but they dont work, how do I modify RewriteCond so that it allows /js/., 开发者_JS百科/css/., and /images/. as well??

please let me know if need more info.

Thank you.


Adding

RewriteCond %{REQUEST_URI} !\.css$
RewriteCond %{REQUEST_URI} !\.js$
RewriteCond %{REQUEST_URI} !^/images/

should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜