Jump to content

.htaccess file issue


matfish

Recommended Posts

Sorry - didn't know which section to post this in...

 

Is there a way to allow the root index.php file to be displayed to all, however making all other directories password protected without putting a .htaccess file in every directory?

 

The idea being I would like a holding page to be present on the root of the domain, but start development beyond that which would be password protected?

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/164396-htaccess-file-issue/
Share on other sites

Thanks for the reply, I have already put a robots.txt file in place and I know that crawlers are supposed to abide by these rules set - however in the past I have still found blog related pages on Google/Yahoo listings before it's offical launch.

 

Which is why I wanted something a bit more secure.

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/164396-htaccess-file-issue/#findComment-867172
Share on other sites

This should do it... The "RewriteRule" says that if the path part of the URL does not start with "/index.php" then -- the "-" means do not rewrite the URL, just process the flag (which is the last part in square brackets) -- the "[F]" means send back a "Forbidden" response, which is an HTTP 403 message header

 

RewriteEngine On

RewriteRule !^/index.php - [F]

 

 

Link to comment
https://forums.phpfreaks.com/topic/164396-htaccess-file-issue/#findComment-867534
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.