URL redirect

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

Post Reply
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

URL redirect

Post by jwalsh »

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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

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.
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

Post by jwalsh »

Ok, I guess I have to learn mod_rewrite then... how hard could it be ? :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there have been several examples of mod_rewrites that do this basic thing in the past here.
Post Reply