How to remove index.php from URLs?

后端 未结 8 1026
我寻月下人不归
我寻月下人不归 2020-11-27 12:02

All of my URLs on my Magento installation require index.php in them, like:

http://example.com/index.php/admin/
http://example.com/index.php/customer/account/         


        
8条回答
  •  旧时难觅i
    2020-11-27 12:47

    If the other solutions don't work for you, try this:

    Step 1: (if your installation is in webroot)

    Replace

        #RewriteBase /magento/
    

    with

        RewriteBase /
    

    Step 2:

    Add following lines (inclusive exclude admin because backend needs index.php internally)

    RewriteCond %{THE_REQUEST} ^.*/index.php
    RewriteRule ^(.*)index.php$ http://www.yourdomain.com/$1 [R=301,L]
    RewriteRule ^index.php/(admin|user)($|/) - [L]
    RewriteRule ^index.php/(.*) $1 [R=301,QSA,L]
    

    right after

    RewriteRule .* index.php [L] 
    

    This works for me

    In case it is still not working, double check Magento configuration: System->Configuration->Web->Search Engine Optimization. Rewrites must be enabled.

提交回复
热议问题