Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How to rewrite subdomain

rewrite subdomain

4:51 pm on Jul 14, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 22, 2009
posts: 92
votes: 0

Hi guys,

I have wildcard dns setup on my server. What I am trying to accomplish it to rewrite a subdomain to a php url.

I tried this:

#RewriteCond %{HTTP_HOST} ^[^\.w{3}]+\.mysite.com$
#RewriteRule ^$ %{HTTP_HOST} [C]
#RewriteRule ^([^\.w{3}]+)\.mysite\.com$ [$1.mysite.com...] [R=301,L]

This works however it keeps the subdomain in the url
and since it i am using joomla i cannot log into those pages because of the subdomain and the menus on the homepage have the subdomain on them and this cause my HOME link to point to the subdomain link i request. However, there is a solution in joomla to enable login, but what i really want to know is what is better for page ranking. Ive seen some sites with subdomains ranking higher for keyword in url which is optimally what id like if it does work.

For SEO purposes. Should i just create a component and have the subdomain redirect to the php url? Will this get indexed by google?

Or should i use this and hard code my menus and build my links to point to the subdomains on the homepage so that they get indexed instead?
2:40 am on July 15, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0

See similar basic problem here: [webmasterworld.com...]

If using the syntax and technique demonstrated in code in that thread doesn't clear up your problem post back here!


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members