Jump to content

Links to my site are 403 forbidden


JJBlaha

Recommended Posts

If you go directly to my site the page loads correctly.  If you click on a link to my site it says

 

Forbidden
You don't have permission to access /index.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. 

 

This started without any changes to anything, as far as I can tell.

Link to comment
https://forums.phpfreaks.com/topic/121055-links-to-my-site-are-403-forbidden/
Share on other sites

Make sure you don't have something like:

 

Order Deny, Allow

Deny from All

 

Or anything like that in your .htaccess or httpd.conf.

 

P.S: If it's in httpd.conf, it would probably be in a <Directory /></Directory> tag to set default directory behavior.

I checked the htaccess and somehow these lines were added, and are causing the problem.  I removed them and restarted apache and everything works.

 

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://1subdomain.domain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://2subdomain.domain.com/.*$      [NC]
... all the others ...
RewriteCond %{HTTP_REFERER} !^http://85subdomain.domain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://86subdomain.domain.com/.*$      [NC]
RewriteRule .*\.([a-zA-Z0-9\-]+)$ - [F,NC]

 

How could this have been added to EVERY htaccess for every subdomain automatically?

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.