为什么找不到子目录

时间:2016-03-28 16:16:13

标签: apache .htaccess

我一直在关注stackoverflow和其他地方的其他答案,但无济于事。

我正在运行虚拟主机localhost并且该网站的主页显示正常,但如果我转到任何子目录/子页面,我会看到此错误:

  

在此服务器上找不到请求的URL / downloads /

总之, mydomain.com 有效,但 mydomain.com/downloads / 不起作用。

通常我通过更改.htaccess修复了本地主机上其他域的此问题。这是我目前的设置:

Apache2.conf

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
网站可用

mydomain.com.lc.conf

    <VirtualHost *:80>
        ServerName mydomain.com.lc
        ServerAlias www.mydomain.com.lc
        ServerAdmin myemail@mydomain.com
        DocumentRoot /var/www/html/mydomain.com.lc/com_mydomain/
        SetEnv APPLICATION_ENV local
        <Directory /var/www/html/mydomain.com.lc/com_mydomain >
                Options Indexes FollowSymLinks MultiViews
                AllowOverride all
                Require all granted
        </Directory>
    <Directory /var/www/var/www/html/mydomain.com.lc/com_mydomain/*>
        Allow from all
        Deny from none
        Order deny,allow
    </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

000-default.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

等/主机

127.0.0.1   mydomain.com.lc

的.htaccess

Options +FollowSymLinks

RewriteEngine On

RewriteBase /

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

我也尝试过不使用.htaccess

0 个答案:

没有答案