4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu
Please consider registering: registration is fast, easy and free! Benefits of registration:
  • Free advertising for your website: Every post in our forums goes towards a "credit" of ads, which are displayed on most pages of our forums. Each post gives you 400 ad impressions. To submit your ad, edit your profile.
  • Discount at TemplateMonster: All our members enjoy a 10% discount at TemplateMonster.com!
  • Private Messages: Exchange private messages with other members of the forums.
  • Message Tracking/Subscription: phpBB enables you to subscribe to threads which interest you, and will then email you when a reply is posted. phpBB also remembers which posts registered users have read during a session, which means you can keep track of which posts you have already looked at.

 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 (7 years, 2 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: 858
Location: UK

PostPosted: Sun Feb 26, 2006 12:49 pm (7 years, 2 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 (7 years, 2 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.053332 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme