我正在localhost上运行一个项目,我的站点地址是 http://localhost/test/a.php/b
。 我希望此网址为用户显示为http://localhost/test/b
。.htaccess重写url以隐藏文件名
a.php是一个php文件,b是它的值。
下面是我的htaccess
文件设置:
Options +FollowSymLinks
RewriteEngine On
RewriteRule \.(css|js|png|jpg|gif)$ - [L]
RewriteRule ^(index\.php|robots\.txt)$ - [L]
RewriteCond %{REQUEST_URI} !(.*)a.php
RewriteRule ^(.*)$ a.php/$1 [L]
你的意思是尝试一个星期?你到目前为止是否尝试过任何htaccess规则? – sjsam
yess很多,但没有得到答案 – saquib