Rewriting URL's

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
shoxlx
Forum Newbie
Posts: 23
Joined: Tue Oct 11, 2005 10:42 pm

Rewriting URL's

Post by shoxlx »

i want a user to type in http://www.shoxlx.com/THEIRNAME.

the folder THEIRNAME wont exist though... i want a script to take the THEIRNAME part and send them to a page where a php script can process their request. how do i go about doing this??

p.s. sry bout the subjuct title... couldnt think of one... lol
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I've editted your thread title for you :)

The keyword's you're searching for (here, google and apache.org) are mod_rewrite and rewrite rules.

There's quite a few threads on this board about it. Regex knowledge will get you started faster ;)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Misc.
shoxlx
Forum Newbie
Posts: 23
Joined: Tue Oct 11, 2005 10:42 pm

Post by shoxlx »

but i dont use apache... i use abyss... how would i go about doin this
Gambler
Forum Contributor
Posts: 246
Joined: Thu Dec 08, 2005 7:10 pm

Post by Gambler »

Simple and portable way: http://www.shoxlx.com/?THEIRNAME
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

hmm, I used abyss once... quite a nifty little server although I don't recall it having a rewriting engine, use apache it's much more powerfull
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You can use PHP to change the query string separators from "?" and "&".... but I'm not sure it would allow you to use "/" for obvious reasons :) Try it anyway. There's a setting for it in php.ini
Post Reply