Resolved 403

jakenetx

New Member
Messages
12
Reaction score
0
Points
1
I get a 403 when trying to get to my site. I can log into cpanel fine and my email still works. Your support pages suggest it may be "might be being blocked by mod_security". Please advise. Thanks.
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
403 can come from improper permissions or missing indexes option.

You should have all of your files in a folder like ~/domains/[your domain name]/public_html and maybe there are some subfolders, which is ok. All of the folders (domains, public_html, subfolders, etc.) all have to be permission of 0644 (owner read/write, everyone else read only) and folders must be 0755 (owner read/write/execute, everyone else read and execute).

If you want to go to yoursite.example (note that there's no folder name at the end) and you want to see a list of files in that folder, you need to add this line to ~/domains/[your domain name]/public_html/.htaccess (the file is a period, followed by htaccess) and add this line:

Code:
Options +Indexes

This will show a list of all the files and subfolders for your website. This is considered a mild security risk because you may have files that people shouldn't know they exist.

The normal way to do things is to NOT use Options +Indexes. Instead, create a file called index.SOMETHING where SOMETHING can be htm, html, or php. This file will show up either when you go to yoursite.example or when you go to yoursite.example/index.SOMETHING
 

spacresx

Community Advocate
Community Support
Messages
2,183
Reaction score
195
Points
63
Just to add to what garrettroyce said,

another option for the .htaccess file that might work for you,
is to add this.

DirectoryIndex index.php
IndexIgnore *

you can change the index.php to your file name, index.htm ,
index.html or index.php

the IndexIgnore * option will hide any files from showing
when you go to yoursite.example.

i use this in my htaccess file without any problems.
 
Top