也许你可以帮我改写我的网址(我从未使用过.htacces文件)。
实施例: 我有这样的网址:http://localhost/index.php?s=example
我如何能够像这样访问此网址:http://localhost/example?
也许你可以帮助我。
谢谢!
答案 0 :(得分:0)
您可以在root/.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ /index.php?s=$1 [NC,L]
此脚本允许您使用干净网址/index.php?s=foobar
/foobar