把index.php 从magento后台的url中移除掉

本文详细介绍了如何在Magento中启用URL重写规则,包括重定向到子文件夹、处理HTTP头部授权、忽略特定文件夹和目录以及重写到index.php等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<IfModule mod_rewrite.c>

## enable rewrites
   Options +FollowSymLinks
   RewriteEngine on

## Rewrite to subfolder magento
   RewriteCond %{HTTP_HOST} ^(www.)?mydomain.cxm$
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ /magento/$1
   RewriteCond %{HTTP_HOST} ^(www.)?mydomain.cxm$
   RewriteRule ^(/)?$ magento/ [L]

## All other rewrite rules apply to magento folder
   RewriteBase /magento/

## workaround for HTTP authorization in CGI environment
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

## always send 404 on missing files in these folders
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

## never rewrite for existing files, directories and links
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

## never rewrite for URI beginning with admin
    RewriteCond %{REQUEST_URI} !^/admin.*

## rewrite everything else to index.php
    RewriteRule .* index.php

## externally rewrite index.php/admin to admin
    RewriteCond %{REQUEST_URI} ^/index.php/admin.*$
    RewriteRule ^index.php/admin(.*) /admin$1 [R]

</IfModule> 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值