我使用htaccess从http到https进行重定向,只将域名重定向到www。我还想要从旧页面到新页面的301重定向。
这是我目前的htaccess。
#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我已经尝试添加此(下方)和其他内容,但没有人进行重定向。
Redirect 301 /cat_cp.asp?cid=179 https://www.amep.com/index.php?route=product/product&product_id=179
我怎样才能使这个工作?