2014-05-22 25 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.