【发布时间】:2016-11-12 04:06:34
【问题描述】:
我的网站上有一个重写规则,例如
example.com/category.php?cat=this becomes example.com/this/
和
example.com/category.php?cat=this&post=example becomes example.com/this/example/
这是 .htaccess 中定义的 mod_rewrite:
<IfModule mod_rewrite.c>
# http://www.generateit.net/mod-rewrite/index.php
# Tell PHP that the mod_rewrite module is ENABLED.
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
RewriteRule ^([^/]*)/$ category.php?cat=$1 [L]
RewriteRule ^([^/]*)/([^/]*)/$ post.php?cat=$1&post=$2 [L]
RewriteRule ^blog-([^/]*).php$ default.php?page=$1 [L]
</IfModule>
我需要在网站上设置 OSCart,并将其放在一个名为 printshop 的文件夹中,以便通过以下方式访问它:
example.com/printshop/
我将如何修改我的 mod_rewrite 以便它不会认为我在调用此页面:
example.com/category.php?cat=printshop
例如将 mod_rewrite 更改为不针对特定目录触发?
【问题讨论】:
标签: apache .htaccess mod-rewrite