LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Debian, Lenny, suEXEC, Apache2, .htaccess rewrite rules don't work anymore. (https://www.linuxquestions.org/questions/linux-server-73/debian-lenny-suexec-apache2-htaccess-rewrite-rules-don%27t-work-anymore-819105/)

Mogget 07-10-2010 12:26 PM

Debian, Lenny, suEXEC, Apache2, .htaccess rewrite rules don't work anymore.
 
Hello.

What is wrong: First page on my sites work, but when trying to enter other pages i get this error: The requested URL /somelink/ was not found on this server. 404 Not found.
There are no errors in suEXECs log file, but Apaches error logfile tells me that the page does not exist, same as what the browser is telling me.

I want to point out that this setup worked perfectly before implementing suEXEC. I now have suEXEC working and all .php code is now run as the user instead of "www-data".

The problem is that the .htaccess file in public_html directory is not read. I am assuming this is the problem since i have some ErrorDocument statements in those exact files which worked nicely before the installation of suEXEC.

The .htaccess file:
Code:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

ErrorDocument 404 /error_pages/error_404.html
ErrorDocument 403 /error_pages/error_403.html
ErrorDocument 401 /error_pages/error_401.html

The files has 664 permissions with the user and group of the sites as owner.

Any suggestions to how to solve this? Is my .htaccess file now redundant or am i missing some important information? Any help would be appreciated as my goggling just made me more stumped on the problem.

Mogget 07-10-2010 06:33 PM

Hello again, after some hours of studying this problem i solved it myself.
When writing my /etc/apache2/sites-avalable/mysite.conf i turned of AllowOverride, meaning i did AllowOverride None inside the directory tabs. This makes it so .htaccess is not read or written as needed.


All times are GMT -5. The time now is 10:57 AM.