Jump to content
deepentim

Make Site directory unaccessable

Recommended Posts

I want to restrict visitors to restrict browsing my website backend directories like:

site/m wire/

Anyone please help me.

I want to display 404 error when a visitor visits

mysite/site/templates/

Infact now when a visitor visits this path it says "Access Forbidden"

Share this post


Link to post
Share on other sites

I am curious why you want to change these, but if you really have a good reason, I think the easiest/only option might be to edit the htaccess file in the PW root, or add htaccess files in the sub directories that you want to change the protection on. This should override the protection added by PW's root htaccess file.

Share this post


Link to post
Share on other sites

I just want to add that the access forbidden response is the correct one to return, because the file/folder in the path is certainly not "not found". At least if you want to adhere to the http specification.

  • Like 1

Share this post


Link to post
Share on other sites

By default, if I try to access http://mysite.com/site/templates/ or /wire, I get an error 404. So I guess you don't need to do anything further.

As for a folder m/ (which must be a custum folder you created, i.e. this is not part of PW core) - just turn off directory listing in your .htaccess, or do a 403.

However, if you reference content from such a folder m/ (e.g. a PDF, an image or whatever) in your regular PW site, a 403 will block access too...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...