fluidsharp Posted November 9, 2013 Share Posted November 9, 2013 Hi, How to block access to http://domain.com/admin/main/ admin panel via htaccess ? I tried like below, but it is not working. RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule .* index.php?/$0 [PT,L] RewriteCond %{REMOTE_ADDR} ^1\.1\.1\.1$RewriteRule /admin/main [F,L] Quote Link to comment https://forums.phpfreaks.com/topic/283754-blocking-access-to-admin-codeigniter-panel-via-htaccess/ Share on other sites More sharing options...
jazzman1 Posted November 21, 2013 Share Posted November 21, 2013 (edited) Assuming, the root web tree structure is like: / - web root /admin /admin/main Put in next code inside /admin directory. RewriteEngine on RewriteBase /admin/ RewriteRule ^\/?main\/.*$ - [F,NC] You can also specify which type of files do not allow to be called: RewriteEngine on RewriteBase /admin/ #RewriteRule ^\/?main\/.*$ - [F,NC] RewriteRule ^\/?main\/.*\.(jpg|jpeg|gif|png|bmp|php|pl)$ - [F,NC] Edited November 21, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/283754-blocking-access-to-admin-codeigniter-panel-via-htaccess/#findComment-1459341 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.