我需要帮助在301永久网址重定向的动态网址
https://www.xyz.co/certificate.php?certify=iso-haccp应重定向到https://www.xyz.co/certificate/iso-haccp-certification
我想用.htaccess文件做,因为有很多这样的网址,帮帮我吧?
发布于 2013-07-19 03:20:53
尝试以下代码:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^certify=(.*)$
RewriteRule ^certificate\.php$ /certificate/%1-certification? [R=301]发布于 2013-07-19 13:46:18
文字重定向将如下所示:
RewriteBase /
RewriteCond %{QUERY_STRING} certify=(iso-haccp)
RewriteRule (certificate)\.php /$1/%1-certification? [R=301,L]在本例中,我们没有在查询字符串周围使用^或$,因为它允许传递其他变量。我在重定向字符串的末尾添加了一个?,以停止查询字符串append的默认行为。
https://stackoverflow.com/questions/17732066
复制相似问题