2016-10-12 28 views
0

我被這個問題困擾了幾天。使用Clean URLs時,所有.html頁面都會重定向到主頁。這發生在靜態和動態生成的頁面上。但是,所有.php頁面都能正常工作。我正在使用以下.htaccess,並且在域上運行SSL。x-cart 5.3.1.3清理URL和靜態頁面不起作用

RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 

此信息來自最初的安裝和幾個在線來源。我不是一個專家,可以真正使用一些幫助。大部分對我來說都是陌生的。

有什麼建議嗎? 謝謝!

+0

此外,所有靜態頁面重定向到即使在清潔URL開關是關閉的主頁。 –

回答

0

試試這個。

<IfModule mod_rewrite.c> 
    RewriteEngine on 

    RewriteCond %{HTTP:Authorization} ^(.*) 
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] 

    RewriteRule (^|/)\. - [F] 

    # Admin.php redirect rules. 
    # Uncomment underlaying lines and replace <new_admin> with your path to admin.php. 
    # Any requests to <new_admin>.php will be redirected to the real admin.php file. 
    # RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
    # RewriteRule ^admin\.php(.*)$ - [NS,NC,L,R=404] 
    # RewriteRule ^<new_admin>\.php(.*)$ admin.php$1 [NC,L,QSA] 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^sitemap.xml(\?.+)?$ cart.php?target=sitemap [NC,L,QSA] 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^((([/_a-z0-9-]+)/)?([_a-z0-9-]+)/)?([_a-z0-9-]+)(/?)(\.([_a-z0-9-]+))?$ cart.php?url=$5&last=$4&rest=$3&ext=$7 [NC,L,QSA] 

    RewriteBase/
</IfModule>