4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Apache ModRewrite
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
UHTMilk
Junior WebHelper
Junior WebHelper


Joined: 25 Feb 2006
Posts: 5

PostPosted: Sat Feb 25, 2006 6:34 pm (11 years, 9 months ago) Reply with QuoteBack to Top

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..
OfflineView User's ProfileFind all posts by UHTMilkSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sun Feb 26, 2006 12:49 pm (11 years, 9 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
UHTMilk
Junior WebHelper
Junior WebHelper


Joined: 25 Feb 2006
Posts: 5

PostPosted: Mon Feb 27, 2006 7:53 am (11 years, 9 months ago) Reply with QuoteBack to Top

Hi there,

Excellent thanks for your help mate.

Cheers again,
Milk
OfflineView User's ProfileFind all posts by UHTMilkSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.11641 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme