我想要将我网站的url从:
http://localhost/bimbsec/v3/index.php?p=page-name
至
http://localhost/bimbsec/v3/page-name
我可以只使用纯PHP函数吗?或者有什么最好的方法?
发布于 2018-02-08 13:32:55
将此文件另存为项目目录中的.htaccess,然后运行如下所示
http://localhost/test/test-page
您将获得类似于$_GET变量中的测试页面
数组(p =>测试页)
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1&
</IfModule>https://stackoverflow.com/questions/48678114
复制相似问题