Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用apachehtaccess清理url_Apache_.htaccess - Fatal编程技术网

使用apachehtaccess清理url

使用apachehtaccess清理url,apache,.htaccess,Apache,.htaccess,如何转换此url http://example.com/vpage/page.php?number=1&status=completed 变成这样一个干净的房间 http://example.com/1/completed 因此,在我的php页面中,我可以回显变量1并完成 谢谢在您的root/.htaccess中尝试此功能 RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCon

如何转换此url

 http://example.com/vpage/page.php?number=1&status=completed 
变成这样一个干净的房间

 http://example.com/1/completed 
因此,在我的php页面中,我可以回显变量1并完成


谢谢

在您的root/.htaccess中尝试此功能

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([0-9]+)/([a-zA-Z0]+)/?$ /vpage/page.php?number=$1&status=$2 [QSA,NC,L]