【问题标题】:can another .htaccess file can work in subfolder另一个 .htaccess 文件可以在子文件夹中工作吗
【发布时间】:2015-03-09 21:18:55
【问题描述】:

我有一个 codeigniter 站点 http://piyukarts.in/mss/ 在 mss 下的 .htaccess 文件中包含

<IfModule mod_rewrite.c>

    Options +FollowSymLinks
    RewriteEngine on

    # Send request via index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

但我无法访问链接http://piyukarts.in/mss/posts,但我可以访问piyukarts.in/mss/index.php/posts,使用此index.php/ after mss/

piyukarts.in/ 是 wordpress 网站,也有一个 .htaccess 文件

请帮忙..提前非常感谢...

【问题讨论】:

    标签: php .htaccess codeigniter


    【解决方案1】:

    我在.htaccess 文件中进行了此更改,现在它工作正常。

    RewriteEngine On
    RewriteBase /mss  
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|robots\.txt|css|docs|js|system)
    RewriteRule ^(.*)$ /mss/index.php?/$1 [L]
    

    【讨论】:

      【解决方案2】:

      回答:

      另一个.htaccess文件可以在子文件夹中工作

      是:

      是的。 .htaccess 文件在文件路径树中的任何文件夹中的文件,都将应用于该文件。

      so 文件为 /root/home/site/includes/css/horses.css 任何这些文件夹中的 htaccess 都将应用于文件 horses.css

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-07-25
        • 1970-01-01
        • 2013-02-01
        • 1970-01-01
        • 2011-01-27
        • 2017-02-01
        • 1970-01-01
        相关资源
        最近更新 更多