2015-05-08 45 views
1

如何設置med.htaccess文件,因此它會重寫www.mydomain.com/index.php?page =訪問www.mydomain.com/home?.htaccess www.mydomain.com/index.php?page=home到www.mydomain.com/home

我試過這段代碼,但它不喜歡我想要的。

RewriteEngine敘述在 RewriteBase /在不對

# Removes index.php from ExpressionEngine URLs 
    RewriteCond %{THE_REQUEST} ^GET.*index\.php?page= [NC] 
    RewriteCond %{REQUEST_URI} !/system/.* [NC] 
    RewriteRule ^([^/]+)/? index.php [L,QSA] 


    # Directs all EE web requests through the site index file 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php?page=$1 [L] 

回答

0

你的第一個重定向規則。您可以使用:

RewriteEngine On 
RewriteBase/

# Removes index.php from ExpressionEngine URLs 
RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&]+) [NC] 
RewriteCond %{REQUEST_URI} !/system/.* [NC] 
RewriteRule^/%1? [R=302,L,NE] 

# Directs all EE web requests through the site index file 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)$ /index.php?page=$1 [L,QSA] 
相關問題