我想在我的Apache中进行url重写,但我不确定它是哪一个。例如,如果有人去www.example.com
点击中有一个选项卡上,默认情况下它会www.example.com/profile.php
我怎样才能把它改写为www.example.com/profile
/或更好,www.example.com
没有/profile/
Apache Url重写或掩码删除扩展名为.php
RewriteEngine On
RewriteCond %{HTTP} on
RewriteRule ^/(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/$1\.php -f
RewriteRule ^/(.*)$ /$1.php [L,QSA]
RewriteCond %{HTTP_USER_AGENT} libwww-perl
RewriteRule^– [F]
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{QUERY_STRING} foo=(.*)
RewriteRule ^grab(.*) /search.php?query=%1
你是否已经尝试改写这个网址? – umka
是的,我附上我的代码。另一件事我该如何重写搜索? –