EricP
EricP

Reputation: 1449

htaccess mod rewrite in an aliased folder not working

I have a site "new.mysite.com" in Drupal. In the vhost file I have a directory "weight-loss" pointing to another location on the server for this website. In that folder I have a mini-site based on Zend Framework which is using mod_rewrite. The mod_rewrite is not working, and I'm thinking it's because this folder is an alias because the exact same mini-site works in another location without being in an aliased folder. The mini-site in in "/home/weight-loss/admin/". The .htaccess file is "/home/weight-loss/admin/.htaccess"

http://new.mysite.com/weight-loss/admin/dashboard/index should be : http://new.mysite.com/weight-loss/admin/index.php?module=dashboard&controller=index

What am I doing wrong?

The vhost settings

<VirtualHost 192.168.100.142:80>
    ServerAdmin [email protected]
    DocumentRoot /home/drupal_1
    ServerName new.mysite.com
    ServerAlias mysite.com www.mysite.com
    Alias /weight-loss /home/weight-loss/
    ErrorLog /var/log/httpd/mysite.com_err_log
      CustomLog /var/log/httpd/mysite.com_log special
    <Directory /home/drupal_1>
      Options FollowSymLinks Includes ExecCGI
              AllowOverride All
              DirectoryIndex index.html index.htm index.php
    </Directory>
</VirtualHost>

The .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /weight-loss/admin/index.php [NC,L]

Upvotes: 1

Views: 234

Answers (1)

Gerben
Gerben

Reputation: 16825

Duplicate the <Directory /home/drupal_1>...</Directory> and change the /home/drupal_1 to /home/weight-loss. That should enable htaccess (and therefor also mod_rewrite)

Upvotes: 2

Related Questions