How htaccess can save your BUTT!

wickedguy

Supreme Member
Joined
Jul 22, 2009
Messages
1,407
Reaction score
1,388
Well, it all started here: http://www.blackhatworld.com/blackh...s/241969-get-your-site-indexed-1-hr-flat.html

Read that thread, I'm NOT going to repeat it here!

Anyway, in short, my host deleted all my domains by accident.

And I was loosing money (still am)! F*

Now what I did, setup some of those domains on another server and changed DNS. On those domains are NO CONTENT! Anyways, traffic are still coming to those domains and if I don't do something real quick, I'm loosing out here if you know what I mean.

In any case, the basic structure of my sites are all the same except for the main sub-folder names. And this is where htaccess is now saving my ass in a BIG way!

Ok I have a kinda BIG site with lot's of content. Then I have smaller sites with less, but basically the same content!

So what the htaccess does is when someone visits one of the empty domains, it redirects to the file on my main domain. If that file does not exist, then my main domain redirects to the error page.

In the meanwhile, I start updating the smaller domains with fresh and old content. So, if a traffic comes to the sites by clicking a link in a search engine, the htaccess checks if that file exist, and if it exists, then the trafic stays at that site.

If it does not exist, the traffic is then redirected to the main domain cause maybe that file is there!

Ok, I'm gonna add the code for the htaccess here, maybe it can be of help to our members.

What I've learnt from this is that all the pages created on all my smaller sites, will from now on also be created on one single domain hosted somewhere else. In the event that the same thing happen again, I will just DNS the other domains and upload my magic formula, which is of course my htaccess! VIOLA!! :D

Here's the example code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^(/)?$ http://homepageofmybackupdomaindotcom [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^smallsitesubfolder/(.*) http://mybackupdomaindotcom/mainsubfolder/$1 [L,R=301]
 
A lesson for all of us who put in the hours and take this shit for granted. Hope your
sites are up and running soon. I use the site in your sig so it nearly gave me a heart
attack to see you post that you'd lost your sites.
 
I don't quite understand...

You .HTACCESS file redirects traffic that comes to empty domains to mybackupdomaindotcom/mainsubfolder/ depending on what subdomains and posts traffic hits?

For example:

Traffic came to dogtraining/emptydomaindotcom/dog-training/

Then it would be redirected to mybackupdomaindotcom/dogtraining/dog-training/

???
 
Back
Top