我写过htaccess文件。我想将https://example.com/index.php?route=product/category&path=1重定向到https://example.com/fashion。PHP网站中的重定向无法正常工作
我的htaccess是
RewriteEngine On
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
但它不是重定向到我已经表明
我写过htaccess文件。我想将https://example.com/index.php?route=product/category&path=1重定向到https://example.com/fashion。PHP网站中的重定向无法正常工作
我的htaccess是
RewriteEngine On
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
但它不是重定向到我已经表明
你可以使用这样的事情对所有请求重定向到的index.php,然后管理从请求链接有usint * HTTP-PATH。 var_dump($ _ SERVER)查看实际请求。
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
如果你想重定向一个特定的请求,那么其他人可能会在稍后帮你。
你可以使用这样的东西。我希望这会帮助你很多。如果不工作访问https://github.com/aice09/htaccess/blob/master/redirects/.htaccess
RewriteEngine On
RewriteRule ^/?category/([^/d]+)/?$ index.php?route=$1 [L,QSA]
我已经写了这两行。但结果仍然不起作用。我正在使用opencart进行此操作。 – Prerana
你的htaccess的名称是否正确?它应该是“.htaccess”而不是htaccess? – Soley
是的,我只写了.htaccess。它正在阅读它,如果我做了任何更改 – Prerana