Mode-Rewrite

Using a single web hosting account to host multiple sites

Postby richardk » Fri Aug 29, 2008 7:21 am

That's not easy.

Do you have a lot of URLs that are one part only (eg. /members/ and /contact/)?
Can member usernames include "/"s?
What is your complete mod_rewrite?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Hi thanks for reply

Postby thebestmind » Fri Aug 29, 2008 9:20 am

Following the my complete url

No this is only part of member/ url

http://en.sitename.com/member/member_nickname/

I just want nickname shifted before the member like following

like.........

http://en.nickname.com/member_nickname/member/

Or hiding the member is better.

Here is my htaccess file.

# Force EVERY URL to contain a language in its first segment.
# Redirect URLs without a language to the invalid xx language.

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^([a-z][a-z])\.sitename\.com
RewriteRule ^(subdomain)?(.*)$ http://en.sitename\.com [NC]

# Language sub domain to index.php.
RewriteCond %{HTTP_HOST} ^([a-z][a-z])\.sitename\.com$ [NC]
RewriteRule ^(.*)$ /index.php/%1/$1 [QSA,L]


#I want change this following. Please modify the following or send me your suggestion.

^([a-z][a-z])\.sitename\.com/member/ [NC]
RewriteRule ^(.*)$ /index.php/%1/$2/$1


Regards,

thebestmind
thebestmind
 
Posts: 7
Joined: Fri May 02, 2008 10:24 am

Postby richardk » Fri Aug 29, 2008 10:14 am

If you want to remove /member, you need to answer
Do you have a lot of URLs that are one part only (eg. /members/ and /contact/)?
Can member usernames include "/"s?


/member_nickname/member/

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(([a-z][a-z])\.sitename\.com)?$ [NC]
RewriteRule ^(.*)$ http://en.sitename.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^([a-z][a-z])\.sitename\.com$ [NC]
RewriteRule ^([^/]+)/member/?$ /index.php/%1/member/profile/$1/ [QSA,L]

RewriteCond %{HTTP_HOST} ^([a-z][a-z])\.sitename\.com$ [NC]
RewriteRule ^(.*)$ /index.php/%1/$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 20 guests

cron