Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

.htaccess file - what do I put in it?

Status
Not open for further replies.

Mr. DeletedMr. Deleted is verified member.

DNForum Mod
Legacy Exclusive Member
Joined
Jul 24, 2004
Messages
4,342
Reaction score
634
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?
 

Beachie

Mr Flippy Returns..
Legacy Exclusive Member
Joined
Aug 13, 2002
Messages
2,003
Reaction score
8
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?
 

MrDude

Level 8
Legacy Platinum Member
Joined
Jun 10, 2005
Messages
1,219
Reaction score
1
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.
 

Blarian

DNF Regular
Legacy Exclusive Member
Joined
Mar 7, 2005
Messages
729
Reaction score
0
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.
 

cyphix

Level 9
Legacy Platinum Member
Joined
Jan 20, 2003
Messages
3,609
Reaction score
1
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.....
 

TogZip

Platinum Lifetime Member
Legacy Exclusive Member
Joined
Jun 19, 2005
Messages
40
Reaction score
0
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
 

Beachie

Mr Flippy Returns..
Legacy Exclusive Member
Joined
Aug 13, 2002
Messages
2,003
Reaction score
8
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.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

Latest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators

Top Bottom