.htaccess 如何使用htaccess更改opencart项目的URL?
我有一个.htaccess 如何使用htaccess更改opencart项目的URL?,.htaccess,url,opencart,.htaccess,Url,Opencart,我有一个opencartproject的URL问题 我安装了oepncartproject,但其URL为: http://www.exmaple.com/opencart/upload 但我想把它显示为: http://www.exmple.com/demo使用.htaccess 我怎样才能改变它 请提供任何帮助。尝试将其添加到文档根目录的htaccess文件中: RewriteEngine On RewriteRule ^demo$ /opencart/upload [L] Rewrite
opencart
project的URL问题
我安装了oepncart
project,但其URL为:
http://www.exmaple.com/opencart/upload
但我想把它显示为:
http://www.exmple.com/demo
使用.htaccess
我怎样才能改变它
请提供任何帮助。尝试将其添加到文档根目录的htaccess文件中:
RewriteEngine On
RewriteRule ^demo$ /opencart/upload [L]
RewriteEngine On # Already in there
RewriteBase /opencart/upload/ # Already there but with value / only
我认为您需要修改
RewriteBase
以从文档根目录指向您的子目录:
RewriteEngine On
RewriteRule ^demo$ /opencart/upload [L]
RewriteEngine On # Already in there
RewriteBase /opencart/upload/ # Already there but with value / only
然后当然要使用重写规则:
RewriteRule ^demo$ /opencart/upload [QSA] # Add this before the next line that is already there
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]