Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perplexing .htaccess/PHP Conundrum

So... I finished a site on my local server, and I uploaded it to my remote server.

Going to the remote site yields an Internal Server error. I think there might be something wrong with the .htaccess file. Here's what it contains:

Options All -Indexes  
Options +FollowSymlinks  
DirectoryIndex launcher.php  
IndexIgnore */*  
RewriteEngine ON  
RewriteRule ^(.*)\.less$ $1.css.php [nc]  
RewriteRule ^([A-Za-z]+)$ launcher.php?page=$1 [QSA,L]

Eventually, I tried to debug the problem by adding # before the DirectoryIndex line to see what would happen. The result:

403 Forbidden

You don't have permission to access /site/ on this server.

Which is puzzling, because all the permissions seem to be ok... I double checked, the .htaccess file has octal 644.

What could be causing this issue? Thanks for any responses in advance.

like image 464
element119 Avatar asked Nov 29 '25 15:11

element119


2 Answers

Thanks to the help SO users, my problem was solved.

Apparently, Apache freaks out if the .htaccess file has permissions set to write, so I was able to fix the problem by chmoding the entire directory and everything in it to 755.

like image 164
element119 Avatar answered Dec 01 '25 08:12

element119


I had the same problem and as the error message says, the file mentioned was having permission 664. I just removed the write permission for group and the permission became 644. That fixed the error.

like image 35
Binod Kalathil Avatar answered Dec 01 '25 08:12

Binod Kalathil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!