2014-05-22 27 views
1

我想從前端刪除index.php,而不是在Magento的後端。請有人幫我解決這個問題。只從前端刪除index.php不在後端magento

我們嘗試通過以下部分使用.htaccess來解決此問題。

 <pre> 
     RewriteCond %{HTTP_HOST} ^example.com$ [NC] 
     RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] 
     RewriteCond %{HTTP_HOST} !^www\. 
     RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 
     RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php(/[^\s\?]+)? [NC] 
     RewriteRule^%1/ [L,R=301]  
     </pre> 

但在使用此代碼後,它會在管理網址中添加額外的反斜槓,從而在管理類別部分中創建問題。我無法擴展所有類別。

如果我使用下面的解決方案,那麼它也從管理網址中刪除index.php。

回答

0

設置system -> configuration -> general -> web -> search engines optimization'使用web服務器重寫'爲yes並清空緩存。

您需要在您的服務器上啓用mod_rewrite。

0

按照下面的步驟刪除從URL中的index.php在Magento

Step 1: 
* Goto to your site root folder and you can find the htaccess file there.Open it on text editor and find the line #Rewrite Base/magento. 
* Just replace it with Rewrite Base/ 

Step 2: 
* Then goto your admin panel and enable the Rewrites(set yes for Use Web Server Rewrites). 
* You can find it at System->Configuration->Web->Search Engine Optimization. 

Step 3: 
* Then goto Cache management page (system cache management) and refresh your cache and refresh to check the site.