Jump to content
xisto Community
BuffaloHelp

Manipulate Htaccess Directoryindex For Parked Domains

Recommended Posts

The question is: can it be done?

I would like to park multiple domains to one hosting. So I can use one total web design and multiple domains to tie them all together.

However, I would like one of domains to have its own DirectoryIndex to be page a.html. Basically, all other domains will go to index.html but when Domain X is used, I want it to go to home.html.

In htaccess, DirectoryIndex home.html will do the result. But this will do for all parked domains.

I was wondering if it can be done with php or any code to achieve this, like RewriteRule or RewriteCond?

Thanks.

PS, I realize that add-on domains will be the simpler way to solve this problem. But that would mean I would have to upload one website design (about 95 files with 200 images) to each of add-on "folder." And that too would be fine except pages are changed and modified almost daily. So uploading 295 files X 6 domains can get very irritating...

==========================

Update

==========================

Not long after I posted this topic, I did little more searching, cussing and pulling my, what's left of, remaining hair and I think I have found a simpler solution.

Manipulating .htaccess RewriteEngine to direct all incoming HTTP_HOST that matches my domain "X" to redirect to "page.html" so that

RewriteEngine OnRewriteCond %{HTTP_HOST} !^http://domain"x".com$ [NC]RewriteCond %{HTTP_HOST} !^http://forums.xisto.com/no_longer_exists/; [NC]RewriteRule ^index\.html$ /file_default_for_this_domain.php [L]

I am not the best in writing .htaccess rewrites, but please help me if I need to clean up my code. But basically, I have domain"x" or http://forums.xisto.com/no_longer_exists/; coming in, for this domain only "file_default_for_this_domain.php" will be the default home page.

If you have index.php as your default page, edit to this rule

RewriteRule ^index\.php$ /file_default_for_this_domain.php [L]

==========================

Update

==========================

Scratch the whole posting from the last update. It does NOT work! Help me... :P

Share this post


Link to post
Share on other sites

Wouldn't google apply penalty for duplicate content? Because if something exactly similar exists in two places google wouldn't like it, even in the same url, so isn't it harsh for seo? If it were to point to a single website, we could have used redirects to the main website. But the problem is the site will redirect even the page urls from one domain to just the domain of the other, and not with same url path. I think I didn't understand something there.

Share this post


Link to post
Share on other sites

Ah ha! Maybe that's why I couldn't find an example on the web. The fear of Google's search rank has led to underdeveloped dynamic htaccess page handling.Yes, it will hurt my SEO. And yes it will probably be frowned by google. I guess I'm not worried about that for now. And google is not the only search engine.In a way, I'm more curious if this can be done. And while I'm perfecting a website for google's sole pleasure, I doubt that my page #20 will be cached by google's search engine. So I'm betting on the hope that my page #20 isn't relative on domain "W", it will matter for domain "X." And so, I'm making page #20 as my index page for my domain "X."

Share this post


Link to post
Share on other sites

Okay, I finally managed to work it out.

Options +FollowSymLinks RewriteEngine OnRewriteCond %{HTTP_HOST} ^www\.domain"x"\.com [NC,OR]RewriteCond %{HTTP_HOST} ^domain"x"\.com [NC]RewriteRule ^$ /file_default_for_this_domain.php [L]

I can't believe I almost had it on my first post... and when it didn't work, I scraped the whole thing and started to write some crazy rewrites!!!! And all this time, all I had to do was drop index\.php from the rewriterule.

This htaccess will execute different file name as its domain "default" index page. This serves my purpose.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.