Hello
I need to replace this exact url string :
/usr/userinfo.php?user=foo
by
/foo
I understand i need to do this with .htacess. But I have not been able to do that with google ssearches on the topic.
Any help would be greatly appreciated.
Thanks a lot
.htaccess help
Moderator: General Moderators
Re: .htaccess help
You want to use mod_rewrite.
Just off the top of my head, it'll be something like this:
[syntax]RewriteEngine On
RewriteBase /
RewriteRule ^foo$ usr/userinfo.php?user=foo[/syntax]
Now that you know, you should be able to Google for the right stuff - you are far from the first person to have questions about mod_rewrite, so there is tons of info out there.
Just off the top of my head, it'll be something like this:
[syntax]RewriteEngine On
RewriteBase /
RewriteRule ^foo$ usr/userinfo.php?user=foo[/syntax]
Now that you know, you should be able to Google for the right stuff - you are far from the first person to have questions about mod_rewrite, so there is tons of info out there.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: .htaccess help
thanks for answering.
There are plenty of answers available in google search. The issue is the term foo is to be replaced by a regex and none of the regex stuff seems to be working on my localhost
thanks anyways
There are plenty of answers available in google search. The issue is the term foo is to be replaced by a regex and none of the regex stuff seems to be working on my localhost
thanks anyways
Re: .htaccess help
Check that you actually have mod_rewrite installed.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: .htaccess help
thanks i guess that was the problem
it works now