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
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

redirect

Post by s.dot »

I need something that will do this

make a link like http://www.domain.com/page.php?user=username
avaiable when someone types in http://www.domain.com/username

I've done this before, I just forget how I did it. :evil:
It involved editing the .htaccess page.

Anyone have any ideas?
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Google *mod_rewrite* or go directly to http://httpd.apache.org/ and look for mod_rewrite module.

UPDATE:

Code: Select all

// example
// rewrites domain.com/article/articlename into domain.com/index.php?article=articlename
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)article/(.*)$ $1index.php?article=$2
Last edited by delorian on Wed Jul 06, 2005 3:03 am, edited 1 time in total.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Appreciated. Thanks. :)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

wow, that documentation just thorougly confused me.

Could someone provide me an example of how to do what I need to do?
Post Reply