Mat*_*iby 0 .htaccess mod-rewrite url-rewriting
好的,所以我在我的opencart应用程序中有这个URL,它运行良好
http://site.com/index.php?route=information/contact
Run Code Online (Sandbox Code Playgroud)
但客户讨厌网址和想要的东西
http://site.com/contact
Run Code Online (Sandbox Code Playgroud)
我想我可以在我的htaccess中做到这一点,一切都会好,但访问网址我什么也得不到
RewriteRule ^(contact)$ index.php?route=information/contact [L,QSA]
Run Code Online (Sandbox Code Playgroud)
有任何想法吗
这是我的htacess
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteRule ^contact$ /index.php?route=information/contact [L,QSA]
Run Code Online (Sandbox Code Playgroud)
删除括号
RewriteRule ^contact$ index.php?route=information/contact [L,QSA]
Run Code Online (Sandbox Code Playgroud)
你的.htaccess应该是这样的:
RewriteEngine On
RewriteBase /
RewriteRule ^contact$ /index.php?route=information/contact [L,QSA]
RewriteCond %{REQUEST_URI} !^/contact$
RewriteRule ^([^?]*) index.php?route=$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2098 次 |
| 最近记录: |