如何从网址中删除的index.php? [英] How to remove index.php from URLs?

查看:259
本文介绍了如何从网址中删除的index.php?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的我的Magento安装的网址需要的index.php在其中,如:

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

http://store.com/index.php/admin/

<一个href="http://store.com/index.php/customer/account/login/">http://store.com/index.php/customer/account/login/

的问题是,该系统默认链接到URL像

The problem is that the system by default links to URLs like

http://store.com/admin/

http://store.com/customer/account/login/

这一下prettier反正。我想这是在.htaccess重写的问题,但与以往修修补补给了我500秒,我想请你们先。

Which look prettier anyway. I assume this is a rewrite issue in .htaccess, but as tinkering with that in the past has given me 500s, I'd like to ask you guys first.

更改SEO设置,刷新配置高速缓存,并重新编制网址没有工作<一个href="http://stackoverflow.com/questions/8451238/magento-htaccess-removal-of-index-php-from-store-urls">as这里建议。

Changing the SEO settings, flushing the configuration cache, and reindexing URLs did not work as suggested here.

推荐答案

我知道这可能是旧的,但我想我会写它只是包住。

I Know this may be old but I thought I would write it just encase.

所以,反正我就是这么做的。

So anyways I did it this way..

---------->

---------->

开始之前确保Apache的重写模块使能,然后按照下面的步骤。

Before you start make sure the Apache rewrites module is enabled, and then follow the steps below.

1)登入到您的Magento管理区域,然后去的系统>配置>网站

1) Log-in to your Magento administration area then go to 'System > Configuration > Web'.

2)导航到不安全安全选项卡。确保无抵押安全 - 基本网址选项有你的域名在其中,并且不离开前进在网址的结尾削减掉。 示例: http://www.yourdomain.co.uk/

2) Navigate to the 'Unsecure' and 'Secure' tabs. Make sure the 'Unsecured' and 'Secure' - 'Base Url' options have your domain name within it, and do not leave the forward slash off at the end of the URL. Example: http://www.yourdomain.co.uk/

3)虽然仍对网络页面,浏览到搜索引​​擎优化选项卡,选择下的使用服务器网址重写选项。

3) While still on the 'Web' page, navigate to 'Search Engine Optimisation' tab and select 'YES' underneath the 'Use Web Server Rewrites' option.

4)再导航到安全选项卡(如果它没有的话),然后选择上的使用安全套的前端网址选项。

4) Navigate to the 'Secure' tab again (if not already on it) and select 'Yes' on the 'Use Secure URLs in Frontend' option.

5)现在去你的Magento网站的文件夹的根目录,并使用此$ C $下你的.htaccess:

5) NoW go to the root of your Magento website folder and use this code for your .htaccess:

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

保存的.htaccess并替换原来的文件。 (请务必备份你原来的.htaccess文件之前,搞乱它!)

Save the .htaccess and replace the original file. (PLEASE MAKE SURE TO BACKUP YOUR ORIGINAL .htaccess FILE BEFORE MESSING WITH IT!!!)

6)现在去'的系统>缓存管理,并选择各个领域,并确保了操作下拉菜单上设置的刷新,然后提交。 (当然,这将刷新缓存。)

6) Now go to 'System > Cache Management' and select all fields and make sure the 'Actions' dropdown is set on 'Refresh', then submit. (This will of course refresh the Cache.)

---------->

---------->

如果这没有工作,请执行以下额外的步骤...

If this did not work please follow these extra steps...

7)该杀系统>配置>网站了。这时候的样子了当前配置范围,并从下拉菜单中选择您的网站。 (这是,如果它被设置为默认配置)

7) Got to 'System > Configuration > web' again. This time look for the 'Current Configuration Scope' and select your website from the dropdown menu. (This is if it is set to Default Config)

8)确保不安全安全字段包含相同的域previous默认配置文件。

8) Make sure the 'Unsecure' and 'Secure' fields contain the same domain as the previous Default Config file.

9)导航到搜索引​​擎优化选项卡,选择使用服务器网址重写部分下面。

9) Navigate to the 'Search Engines Optimisation' tab and select 'Yes' underneath the 'Use Web Server Rewrites' section.

10)一旦URL是相同的,并且改写启用保存该页面,然后回去,并确保它们都是被选中作为默认话又说回来,如果需要保存。

10) Once the URLs are the same, and the rewrite is enabled save that page, then go back and make sure they are all checked as default then save again if needed.

11)重复步骤6。

现在你的index.php问题应该是固定的,都应该很好!

Now your index.php problem should be fixed and all should be well!!!

我希望这有助于。

这篇关于如何从网址中删除的index.php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆