Jump to content


Photo

mod_rewrite ?


  • Please log in to reply
3 replies to this topic

#1 Roee

Roee
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 21 July 2006 - 07:11 PM

i want to get this addres:
http://www.domain.com/USER

and change USER to: /members/USERS

http://www.domain.com/USER
resolves to
http://www.domain.com/members/USER


how should i do it?

#2 number9dream

number9dream
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 21 July 2006 - 10:00 PM

You haven't explained your problem very clearly. Perhaps you could give a real world example?

The over-literal answer is

RewriteRule ^USER /members/USER [R=301,L]

Without knowing more details of your problem, a good answer is impossible.

#3 Roee

Roee
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 23 July 2006 - 12:11 PM

i have a users system.
each user have a control panel & control of his site.
i want to make the site address of each user like his username, so if i get in to this address: http://www.domain.com/USER
i will automatic transfer (by mod_rewrite) to:
http://www.domain.com/members/USER

thanks

#4 number9dream

number9dream
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 23 July 2006 - 02:27 PM

Presumably, you have other pages at the root of www.domain.com that you don't want to eb re-written?

The reason for my questions is that to have an effective rule, you need to identify the pattern that you want to match. At the moment, the pattern seems to be any character whatsoever, which is fine if you want to redirect everything (i.e. www.domain.com/* to  www.domain.com/members/*). I'm just not sure if that's what you really want to do?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users