|
Author |
Message |
UHTMilk
Junior WebHelper
Joined: 25 Feb 2006
Posts: 5
|
Posted:
Sat Feb 25, 2006 6:34 pm (18 years, 1 month ago) |
|
Hello there,
I was just wondering if anybody could advise me on how to use the apache rewrite module to do like myspace does ie domian.com/bob to domain.com/index.php?a=bob...
I get the basics of the module but this has been nothering me and I can't seem to get a lear answer by googling. It obviously causes problems when trying to access index.php etc... Ideally I don't want to use a work-around such as mydomain.com/person/bob but I'm oviously not conversant enough with the module syntax to work out how to do it.
I'd be grateful if anybody could lend any advice or point me in the right direction.
Cheers,
Milk.
EDIT: n.b. Sorry I guess I should have added this in the apache section. Chalk this one up to my temporary blindness.. |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sun Feb 26, 2006 12:49 pm (18 years, 1 month ago) |
|
Moved to Web Servers.
To do what you want, you'll need to add a condition excluding index.php. The end result might look something like this:
Code: | RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !^index\.php$
RewriteRule ^([a-zA-Z0-9]+)$ /index.php?a=$1 [L] |
That is assuming the user-names only contain letters and numbers, but you can change it to (.*) or something else. |
________________________________ It's turtles all the way down... |
|
|
|
UHTMilk
Junior WebHelper
Joined: 25 Feb 2006
Posts: 5
|
Posted:
Mon Feb 27, 2006 7:53 am (18 years, 1 month ago) |
|
Hi there,
Excellent thanks for your help mate.
Cheers again,
Milk |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.139758 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |