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
精彩评论