我如何在.htaccess中删除文件参数


how i can remove the parameter of file in .htaccess

我的htaccess文件有问题问题是:我有像www.example.com/PlayList.php?v=1这样的链接,我需要把它转换成这种方式www.example.com/PlayList/1

我试过这个代码,但它不与我工作,我不知道的方式>没有错误

Options +FollowSymLinks -MultiViews
RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}'s([^.]+)'.php [NC]
RewriteRule ^ %1 [R,L]
 RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
 RewriteCond %{REQUEST_URI} ^/PlayList/
RewriteCond %{QUERY_STRING} v
RewriteRule (.*) /$1? [R=301,L]

您可以使用:

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} /PlayList'.php'?v=([^'s&]+) [NC]
RewriteRule ^ /PlayList/%1? [R=302,L,NE]
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}'s([^.]+)'.php [NC]
RewriteRule ^ %1 [R,L]
RewriteRule ^PlayList/('d+)/?$ PlayList.php?v=$1 [L,QSA,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]