Do you have a question? Post it now! No Registration Necessary. Now with pictures!
December 24, 2005, 5:50 pm
rate this thread
I have looked around on how to do this but noone seems to know how to
I hope by starting this thread I will get to a solution and help other
people searching as it is a commons issue..
This is the background and what I have done till now.
So, I have cpanel access from my provider, also I am a reseller and
have whm access.
until now, I found a way to convert :
http://example1.mydomain.com to http://www.mydomain.com/example1
this can be done easily using the .htaccess file on the root of your
So just edit or create the file .htaccess and make sure it contains
those lines :
RewriteCond % !^www\.mydomain\.com
RewriteCond % ([^.]+)\.mydomain\.com [NC]
RewriteRule ^(.*)$ http://mydomain.com/%1 [L,R]
replace "mydomain" with your domain
the last line can be modified to redirect a domain anywhere you want.
for example replacing the last line with :
RewriteRule ^(.*)$ http://mydomain.com/index.php?value=%1 [L,R]
will result in visitors visiting "http://example1.mydomain.com " to be
taken to http://mydomain.com/index.php?value=example1
all this will hapen provided you have already a folder named example1
in your file structure!
I am trying to redirect people without having this folder there.
Anyone got any ideas?
I tested my domain to see if it catches all subdomains by default by
visiting foo.mydomain.com , it doesn't , i receive an error page.
I thought i should modify the dns zones.
I cannot do this in my main domain, as cpanel does not give that
so i experiment using a domain un my whm
I go to Main >> DNS Functions >> Edit DNS Zone in the whm .
I add a zone *.mydomain.com. 1440 A 188.8.131.52 (my shared
ip that is repeated in all the other entries)
after doing that, and using the htaccess file, example1.mydomain.com
returns a blank page instead of an error page.
I suspect this page is blank by default and is located somewher else,
not in my directories.
Any ideas on what else I could do? Any wrong in my thinking?
- » Top Tips for Web Designers....Post your best tips here.
- — Previous thread in » Webmaster Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum