Search code examples
phpapache.htaccessmod-rewritemodx

Modx. Apache URL Rewrite issue


I faced with URL rewrite issue. Please help me to understand where is the problem or show me the way where to look.

Before the issue appeared I moved my modx evo to another host. There I faced with compatiblity issue. I used modx 1.0.6. On server installed php 5.5 (I can't find information about compatibility modx and php5.5. Everything except url rewrite is working well). I upgraded modx to 1.0.15

So to reproduce the issue you need to enable frendly urls and open any page. You get following error:

Not Found

The requested URL /gallery was not found on this server.

Apache/2.4.7 (Ubuntu) Server at zvezda-vostoka.ru Port 80

Here is htaccess:

php_flag register_globals Off
AddDefaultCharset utf-8
php_value date.timezone Europe/Moscow

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.zvezda-vostoka\.ru [NC]
RewriteRule (.*) http://www.zvezda-vostoka.ru/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Solution

  • I put Deny from all at the beginning of .htaccess.

    Saw that nothing happen.

    Then saw AllowOverride None in apache config for <Directory /var/www/>.

    And changed it to AllowOverride All