• Welcome to DNForum.com - Domain Investor Forum, Free Domain Marketplace and a community for 45+ domain pros
    If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the oldest global domain name community on the internet and continues to grow every day. There are over 45,000 domainers on DNForum doing everything from buying domains, selling domains, using our free in-house built tools, learning about domains and discussing domains. Take a minute and Register.

.htaccess file - what do I put in it?

Status
Not open for further replies.

Mr. DeletedMr. Deleted is verified member.

DNForum Mod
DNF Moderator
The Originals
Legacy Exclusive Member
Joined
Jul 24, 2004
Messages
4,465
Reaction score
731
PHP:
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.deleted.com
AuthUserFile /home/deleted/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/deleted/public_html/_vti_pvt/service.grp

I just set up wild card dns on deleted.com and am wondering what to put into htaccess to make anything.deleted.com forword to deleted.com, or whereever I want it?
 
anything.deleted.com should automatically forward to the root of www.deleted.com if you add the following to your apache httpd.conf (assuming you're using apache..). Under the <VirtualHost> tag for deleted.com, set your ServerAlias like this:

ServerAlias *.deleted.com deleted.com

You can do fancy .htaccess forwarding something like this:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^.*/somefolderthatalreadyexists/
RewriteCond %{REQUEST_URI} !^.*/anotherfolderthatalreadyexists/
RewriteRule ^([^/\.]+)?/?([^/\.]+)?/?([^/\.]+)?/?([^/\.]+)?/?$ index.php?P=$1&link1=$2&link2=$3&link3=$4 [L]


That should forward http://pants.deleted.com to http://www.deleted.com/pants
Depending on your site, you'll need to mess around a bit with that...

The RewriteCond lines should contain any existing folders that you don't want forwarding to work for. For example, you don't want http://cgi-bin.deleted.com to forward to http://www.deleted.com/cgi-bin

Also, just for fun, did you know that you can use underscores in third-level domains? So http://no_pants.deleted.com will work..

Mr. Deleted said:
PHP:
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.deleted.com
AuthUserFile /home/deleted/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/deleted/public_html/_vti_pvt/service.grp

I just set up wild card dns on deleted.com and am wondering what to put into htaccess to make anything.deleted.com forword to deleted.com, or whereever I want it?
 
the following

Code:
# -FrontPage- 

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* 

<Limit GET POST> 
order deny,allow 
deny from all 
allow from all 
</Limit> 
<Limit PUT DELETE> 
order deny,allow 
deny from all 
</Limit> 
AuthName www.deleted.com 
AuthUserFile /home/deleted/public_html/_vti_pvt/service.pwd 
AuthGroupFile /home/deleted/public_html/_vti_pvt/service.grp

Is not needed in htaccess if you delete the frontpage folders vti_ and _private which is just crap generated by cPanel.
 
Mr. Deleted said:
well now, deleted.com is not coming up, it is all messed up since I messed with the .htaccess file

Ive had that happen before too, just delete everything in the file until you can be certain that nothing is wrong with your coding.
 
can anyone help me figer it all out? I have WHM, and my host set the wild card up, they are really nice about stuff like that...
 
If you want to forward wildcard subdomains then I believe your host has to do something with the MX Records like setup a C NAME or something.....
 
try this

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.deleted\.com$
RewriteCond %{HTTP_HOST} !^www\.deleted\.com$
RewriteRule (.*) http://deleted.com/%1$1 [P]

%1 is the directory and $1 are the requested files.

so anything.deleted.com/index.html will show deleted.com/anything/index.html

if all subs should go to one directory change RewriteRule to

RewriteRule (.*) http://deleted.com/fixeddirectory/$1 [P]

hope it will help, if not read here http://www.webmasterworld.com/forum92/138.htm

regards Tog
 
Mr. Deleted said:
mx is a mail record, c name is different then mx. I just never did this before, and don't want to mess it all up...
Send me an email at [email protected] with exactly what you want, and how you want it forwarding, and I'll do it for you.

Cheers,
Chris.
 
Status
Not open for further replies.
Back
Top Bottom