.htaccess文件上的mod_rewrite从远程本地分割

时间:2015-03-07 02:20:26

标签: .htaccess mod-rewrite

基本上我正在寻求改进以下代码...

RewriteEngine On
RewriteRule ^(control|admin|scripts|É)(/|$) - [L]
RewriteCond %{DOCUMENT_ROOT}$0 -d
RewriteRule ^[^/]+ - [L]


# Local

RewriteRule ^([a-z-]*)/$ index.php?a=$1 [L] 
RewriteRule ^([a-z-]*)/([a-z-]*)/$ index.php?a=$1&b=$2 [L]
RewriteRule ^([a-z-]*)/([a-z-]*)/([a-z-]*)/$ index.php?a=$1&b=$2&c=$3 [L]


# Local/live (Rackspace Cloud Sites)

# RewriteRule ^([a-z-]*)/$ /index.php?a=$1 [L] 
# RewriteRule ^([a-z-]*)/([a-z-]*)/$ /index.php?a=$1&b=$2 [L]
# RewriteRule ^([a-z-]*)/([a-z-]*)/([a-z-]*)/$ /index.php?a=$1&b=$2&c=$3 [L]

您会注意到我的本地计算机有一组重定向,以及在服务器(Rackspace Cloud Sites)上传时的一组重定向。由于某种原因,本地重定向不能在索引之前具有/。理想情况下,我想结合2,任何帮助将不胜感激。

0 个答案:

没有答案