我想将我的网址改写为干净的网址,并用其他网址替换 原始网址 http://www.sitename.com/movie?name=gold-2018-full-movie
干净的网址 http://www.sitename.com/gold-2018-full-movie
.htaccess中的代码是
RewriteEngine On
RewriteRule ^([^/.]+)$ $1.php [L]
RewriteRule ^movie/([-\w]+)/$ movie.php?name=$1 [L]
答案 0 :(得分:0)
尝试一下:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+movie\.php\?name=([^\s&]+) [NC]
RewriteRule ^ movie/%1? [R=301,L]
RewriteRule ^movie/([^/]+)/?$ movie.php?name=$1 [L,QSA]