How to alias a php page to look like abcxyz.com/MYALIAS

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
cardinal
Forum Newbie
Posts: 14
Joined: Mon Jun 01, 2009 2:29 pm

How to alias a php page to look like abcxyz.com/MYALIAS

Post by cardinal »

Hi all,

I think this should go under the PHP code forum, but if not, mods please move it accordingly or PM me and I'll delete it.

Basically I'm looking to run a single PHP script that will take the info after the backslash and accordingly process the corresponding data.

I.e. say I have a website: http://www.abcxyz.com, and I wish users to be able to make accounts on there but not have to remember some long URL like http://www.abcxyz.com/page.php?user=joe, rather I want to be able to type into the URL http://www.abcxyz.com/joe and be able to use my page.php script to parse that data and bring up the corresponding page. (think what myspace/facebook does)

i'm not sure if PHP is the correct/best method for this, I did find some resource on http://www.php.net/urlhowto.php where it details some info regarding how the search is performed if no exact file is found, but it's not really clear.

does anyone have any reccomendations or tips?

cheers,
card
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: How to alias a php page to look like abcxyz.com/MYALIAS

Post by kaszu »

Do a search for "url rewrite"
cardinal
Forum Newbie
Posts: 14
Joined: Mon Jun 01, 2009 2:29 pm

Re: How to alias a php page to look like abcxyz.com/MYALIAS

Post by cardinal »

Thanks for this!! I didn't even know the correct search term, I kept thinking it was "alias"-ing and got all these other sites instead.

I did a google search on URL rewriting and I'm pretty confident this is exactly what I need, thanks!

Cheers,
Card
Post Reply