PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jwalsh
Forum Contributor
Posts: 202 Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH
Post
by jwalsh » Wed Sep 07, 2005 5:22 pm
Hi,
I'd like to experiment with changing a hand entered url into a properly formatted dynamic url. Ex...
entered:
http://www.example.com/username
redirect to:
http://www.example.com/index.php?user=username
I think you could do this with the current path, and a meta-refresh. I'd prefer to stay away from mod_rewrite if possible. Anyone have experience with this?
Josh
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Wed Sep 07, 2005 5:35 pm
That's probably only going to be possible with .htaccess files. Unfortunately, I don't know much more than that, other than you'll need mod_rewrite.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
jwalsh
Forum Contributor
Posts: 202 Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH
Post
by jwalsh » Wed Sep 07, 2005 6:19 pm
Ok, I guess I have to learn mod_rewrite then... how hard could it be ?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Sep 07, 2005 7:25 pm
there have been several examples of mod_rewrites that do this basic thing in the past here.