2016-05-30 55 views
0

這裏是我所有的htaccess代碼htaccess的mod_rewrite的與預期

#Options -MultiViews 

    RewriteEngine on 

    RewriteBase/

    RewriteCond %{REQUEST_FILENAME} !-d 

    RewriteCond %{REQUEST_FILENAME} !-f 

# 
# This Conditions is for admin 
# 

    RewriteRule ^admin/$      admin/index.php     [L] 
    RewriteRule ^admin/(index|login|process|action|logout|ajax|controller).php admin/$1.php?    [QSA,L] 
    RewriteRule ^admin/(.*).php    admin/controller.php?plugin=$1     [QSA,L] 
    RewriteRule ^admin/(.*)     admin/router.php?t=$1        [QSA,L] 

# 
# This Conditions is for Themes 
# 

    RewriteRule ^theme/(.*) view/themes/$1     [QSA,L] 

    RewriteRule ^admin_theme/(.*) view/admins/$1    [QSA,L] 

# 
# This Conditions is for App 
# 
    RewriteRule ^(.*).(css|js|png|jpg|jpeg|gif|woff|ttf|otf|mp3|mp4|ogg)$  app/$1.$2  [QSA,L] 

    RewriteRule (post_comment|feed|login|action|reset|index).php  app/$1.php   [QSA,L] 

    RewriteRule ^$    app/index.php     [L] 

    RewriteRule ^(.*)?   app/router.php?regex=$1    [QSA,L] 

    RewriteRule (.*)   app/$1       [QSA,L] 

每一件事工作正常2.4的Apache不能工作,但這個條件

RewriteRule ^admin/(.*).php admin/controller.php?plugin=$1 [QSA,L]

重定向到這個鏈接 /應用/ router.php?regex = site.com/admin/users.php

但我應該是這樣

site.com/admin/controller.php?plugin=users &

我工作在本地主機上**找到XAMPP *沒有問題

,但上傳到服務器的Apache 2.4後問題衝擊片雷管

我使用這個網站來檢查我的htaccess代碼

http://htaccess.mwl.be/

請告訴我是這裏的問題以及應如何與Apache工作2.4

回答

0

逃離特殊字符.用反斜槓\.

RewriteCond %{HTTP_HOST} ^alalmea.art4muslim.net 
RewriteRule ^admin/(.*)\.php /admin/controller.php?plugin=$1  [QSA,L] 

對於PCRE,和大多數其他所謂稱爲Perl兼容風味,逃避這些外部字符類:

.^$*+?()[{\| 
+0

無法正常工作,仍然發送給'/app/router.php?regex = site.com/admin/users.php' – Momaiz

+0

嘗試'RewriteRule^admin /(。*)\。php /admin/controller.php?plugin = $ 1 [QSA,L]' –

+0

我看不到任何不同 **注意:我在子域上工作** – Momaiz