htaccess mod在别名文件夹中重写不起作用



我在Drupal中有一个网站"new.mysite.com"。在vhost文件中,我有一个目录"减肥"指向该网站服务器上的另一个位置。在那个文件夹中,我有一个基于Zend Framework的迷你网站,它正在使用mod_rewrite。mod_rewrite不起作用,我想这是因为这个文件夹是一个别名,因为完全相同的迷你网站在另一个位置工作,而不在别名文件夹中。"/home/减肥/admin/"中的迷你网站。.htaccess文件是"/home/减肥/admin/.htaccess"

http://new.mysite.com/weight-loss/admin/dashboard/index应为:http://new.mysite.com/weight-loss/admin/index.php?module=dashboard&控制器=索引

我做错了什么?

vhost设置

<VirtualHost 192.168.100.142:80>
    ServerAdmin serveradmin@bbgi.com
    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>

.htaccess文件:

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]

复制<Directory /home/drupal_1>...</Directory>并将/home/drupal_1更改为/home/weight-loss。这将启用htaccess(因此也启用mod_rewrite)

最新更新