开发者

htaccess rule for redirection of any particular name to particular page

I am using PHP and I need to use a name say "Pranav dave" in url which s开发者_StackOverflow中文版hould redirect me to "myprofile.php" what should i do?.. also the url should display me "Pranav dave".. and what should be the htaccess rule to redirect any html file to php file?


You could make it like this:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ myprofile.php?profile=$1 [NC]

After that, you can use your urls like this http://example.com/Pranav dave. The only problem is, that the browser will rewrite the url, and after that, its looking like followink one http://example.com/Pranav%20dave

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜