我有以下页面:www.domain.com/index.php?route=information/contact
,我想改写它,这样它显示为:www.domain.com/contact
,但还有更多......如何重写URL以便可以将重写输入到URL栏中?
什么是重要的,就是当在www.domain.com/contact
有人类型,它重定向他们到www.domain.com/index.php?route=information/contact
,这又被重写为www.domain.com/contact
。
我感谢任何帮助!谢谢。
编辑:澄清
我希望用户能够进入www.domain.com/contact
和被重定向到www.domain.com/index.php?route=information/contact
。
然而,一旦重定向,我想一个纯粹的审美改写使www.domain.com/index.php?route=information/contact
显示为www.domain.com/contact
(同他们在键入。)
这可能吗?
编辑:目前我的.htaccess文件...
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://www.domain.com/? [R=301,L]
### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling, then restore the # as this means your host
doesn't allow that.
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This
may work to disable it:
# php_flag register_globals off
你描述将创建一个无限重定向什么... 重定向联系? - >的index.php路线=信息/接触 重定向的index.php路线=信息/ contect - >接触 确定这就是你想要做的? – 2011-05-02 01:32:17
@David - 我只希望'index.php?route = information/contact'被重写(不重定向)......只是纯粹的美学 - 但关键是人们需要能够输入审美URL ,并将其重定向到真实网址......这将(仅在外观上)与审美网址相同。 – jlmakes 2011-05-02 02:08:28
但是审美的URL将不得不重写。为什么不使用功能性URL来运行脚本? – 2011-05-02 02:16:44