Php 如何使用htaccess更改URL

Php 如何使用htaccess更改URL,php,.htaccess,Php,.htaccess,我还想隐藏.php扩展名 我的网址是: www.mysite.com/Alumni/searchprofile?profile=maria_s 我想把它改成: www.mysite.com/Alumni/maria_s 有什么线索吗?我需要尽快答复 请检查这个 <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\

我还想隐藏.php扩展名

我的网址是:

www.mysite.com/Alumni/searchprofile?profile=maria_s
我想把它改成:

www.mysite.com/Alumni/maria_s 
有什么线索吗?我需要尽快答复

请检查这个

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}\.php-f
重写规则^(.*)$$1.php
欲了解更多信息,请访问:

希望这会有所帮助。

试试这个:

RewriteEngine On
RewriteBase /
RewriteRule ^Alumni/([^/]*)$ /Alumni/searchprofile?profile=$1

# Hide php extension.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

你的问题毫无意义,考虑到你所拥有的和你想要改变的是完全相同的东西。有人发现
www.mysite.com/alumina/searchprofile?profile=maria_s
www.mysite.com/alumina/searchprofile?profile=maria_s
之间的区别吗?对不起,我想要我的URL是:www.mysite.com/alumina/searchprofile?profile=maria_s,我想将其更改为:www.mysite.com/alumina/maria_scan u发送完整代码,我想隐藏.php ext tooo