.htaccess 如何为子矩形创建异常,以便主HTacces赢得';不干扰子目录?

.htaccess 如何为子矩形创建异常,以便主HTacces赢得';不干扰子目录?,.htaccess,subdirectory,.htaccess,Subdirectory,我有一个运行ELGG1.8的主网站,它需要自己创建的htaccess才能正常运行。但是现在我想在我的主文件夹中创建一个子目录,而main/htaccess把它搞砸了,我无法访问该文件夹,只运行html文件,没有php,什么都没有 如何编辑此.htaccess以创建异常 <IfModule mod_rewrite.c> RewriteEngine on # If Elgg is in a subdirectory on your site, you might need to ad

我有一个运行ELGG1.8的主网站,它需要自己创建的htaccess才能正常运行。但是现在我想在我的主文件夹中创建一个子目录,而main/htaccess把它搞砸了,我无法访问该文件夹,只运行html文件,没有php,什么都没有

如何编辑此.htaccess以创建异常

<IfModule mod_rewrite.c>

RewriteEngine on

# If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
# containing the path from your site root to elgg's root. e.g. If your site is
# http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need
#
#RewriteBase /sites/elgg/
#
# here, only without the # in front.
#
# If you're not running Elgg in a subdirectory on your site, but still getting lots
# of 404 errors beyond the front page, you could instead try:
#
#RewriteBase /

# In for backwards compatibility
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/page_handler.php?handler=$1&%{QUERY_STRING}
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2&%{QUERY_STRING}
RewriteRule ^tag\/(.+)\/?$ engine/handlers/page_handler.php?handler=search&page=$1


RewriteRule ^action\/([A-Za-z0-9\_\-\/]+)$ engine/handlers/action_handler.php?action=$1&%{QUERY_STRING}

RewriteRule ^cache\/(.*)$ engine/handlers/cache_handler.php?request=$1&%{QUERY_STRING}

RewriteRule ^services\/api\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/service_handler.php?handler=$1&request=$2&%{QUERY_STRING}

RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/?$ engine/handlers/export_handler.php?view=$1&guid=$2
RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4

RewriteRule xml-rpc.php engine/handlers/xml-rpc_handler.php
RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_handler.php


# rule for rewrite module test during install - can be removed after installation
RewriteRule ^rewrite.php$ install.php

# Everything else that isn't a file gets routed through the page handler
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([A-Za-z0-9\_\-]+)$ engine/handlers/page_handler.php?handler=$1 [QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2 [QSA]


</IfModule>

重新启动发动机
#如果Elgg位于站点的子目录中,则可能需要添加一条基线
#包含从站点根目录到elgg根目录的路径。e、 如果你的网站是
# http://example.com/ 埃尔格也在http://example.com/sites/elgg/,您可能需要
#
#重写基地/站点/elgg/
#
#在这里,只有前面没有#。
#
#如果您没有在站点的子目录中运行Elgg,但仍然得到很多
#在头版以外的404个错误中,您可以尝试:
#
#重写基/
#为了向后兼容,请输入
重写规则^pg\/([A-Za-z0-9\\\-]+)$engine/handlers/page_handler.php?handler=$1&%{QUERY_STRING}
重写规则^pg\/([A-Za-z0-9\\\-]+)\/(.*)$engine/handlers/page\u handler.php?handler=$1&page=$2&%{QUERY\u STRING}
重写规则^tag\/(.+)\/?$engine/handlers/page\u handler.php?handler=search&page=$1
重写规则^action\/([A-Za-z0-9\\\-\/]+)$engine/handlers/action\u handler.php?action=$1&%{QUERY\u STRING}
重写规则^cache\/(.*)$engine/handlers/cache\u handler.php?请求=$1&%{QUERY\u STRING}
重写规则^services\/api\/([A-Za-z0-9\\\\-]+)\/(.*)$engine/handlers/service\u handler.php?handler=$1&request=$2&%{QUERY\u STRING}
重写规则^export\/([A-Za-z]+)\/([0-9]+)\/?$engine/handlers/export\u handler.php?视图=$1&guid=$2
重写规则^export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\\\+)\/$engine/handlers/export\U handler.php?视图=$1&guid=$2&type=$3&idname=$4
重写规则xml-rpc.php引擎/handlers/xml-rpc_handler.php
重写规则mt/mt-xmlrpc.cgi引擎/handlers/xml-rpc_handler.php
#安装期间重写模块测试的规则-可在安装后删除
重写规则^rewrite.php$install.php
#非文件的所有其他内容都通过页面处理程序进行路由
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^([A-Za-z0-9\\\-]+)$engine/handlers/page_handler.php?handler=$1[QSA]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^([A-Za-z0-9\\\-]+)\/(.*)$engine/handlers/page\u handler.php?handler=$1&page=$2[QSA]

在htaccess文件上的
重写引擎正下方,添加此规则以允许目录请求通过:

RewriteRule ^directory/to/pass/through - [L]
当有人请求
http://your.domain.com/directory/to/pass/through
,重写引擎将让它通过,而不会干扰它