Hi guys (yeah, I know you missed me...).
I use the multisite (clone zenphoto plugin, yes !) and I have two domain names :
site1.com > main installation
site2.com > cloned installation
The main installation runs fine on site1.com but I don't understand how to configure .htaccess for the cloned gallery in order to use site2.com for it (I hope it's clear).
Any idea ?
Comments
yes, I realized that but I'd like to use the domain name site2.com for the cloned installation in a "transparent" way.
To be clearer, I want my .htaccess to replace in the navigation bar http://www.site1.com/site2/ by http://www.site2.com.
Am I clear ?
Put both installs in folders /site1 and /site2 on your webspace root and then link the domains to those folders. They are then the "root" for those domains. I am sure your host has something for that on its webspace admin. If not you could redirect via a htaccess in the root to those folders.
If you have more than one domain each site you need to make one to the main domain ("Duplicated content" avoiding). You then could do that via a htcacess in the root, too.
I just need http://www.site1.com/site2/ to be replaced by http://www.site2.com as if it was the root.
What I am looking for is a way to do this in the .htaccess to get it...
http://www.htaccessredirect.net
http://www.htaccessredirect.co.uk
Sorry to have asked.
site2 is in a subdirectory of the site1 root.
The .htaccess are already rewrited base :
site1.com .htaccess :
`
IndexIgnore *
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
RewriteCond %{HTTP_HOST} ^site2.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.site2.com$
RewriteRule ^/?$ "http\:\/\/www\.site1\.com\/site2/" [R=301,L]
`
site2.com .htaccess :
`
IndexIgnore *
RewriteEngine On
RewriteBase /site2
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
`
But when I try to connect to site2.com, I'm redirected to site1.com.
Something must be wrong, but... what ?
Also your domain redirection should go before the other rewrite ones. Also one rewriteCond per one RewriteRule.
Try this:
`
RewriteCond %{HTTP_HOST} ^site2\.com$ [NC]
RewriteRule ^(.*)$ http://www.site1.com/site2/$1 [L,R=301]
`
An then no `RewriteBase /site2` but `RewriteBase /`. There is no folder used anymore if you redirect it!
"Again it would be all easier if you would redirect the domain via your host directly to the /site2 folder. "
Already done.
I've made the change but site2 is still redirected to site1.
Here are the .htaccess :
Site1.com :
`
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
IndexIgnore *
`
Site2.com :
`
IndexIgnore *
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site2\.com$ [NC]
RewriteRule ^(.*)$ http://www.site1.com/site2/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
`
Site2.com is still redirected to site1.com.
Help (I need somebody, heeeelp).
You are really over complicating things here…
That's all me... I'm giving a try right now.
.htaccess site1 :
`
IndexIgnore *
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
`
.htaccess Site2 :
`
IndexIgnore *
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
`
Stuck.
First you need either a rewrite base or you need to explicitly include folder names or your file tests and redirects will most likely look in the wrong place. Then your config file will need to have have explicit defines for the WEB and server paths because zenphoto will not be able to sort things out.
I am at a loss as to why you do point your domains directly to the correct folder and let everything work normally. If you actually succeed the way you are going you will have created for yourself a maintenance nightmare.
In fact I say "ok" but I don't get it at all.
I can't change something on site1.com (production) but I can change anything on site2.com.
Concretely, what am I supposed to do to avoid "a maintenance nightmare" ?
Really, again my suggestion to put both in their own folders in the root of your webspace and redirect the domains via your webhost's interface to those folders. Then run setup on each or change the rewritebase htaccess entry to `rewriteBase /` and you are done. Nothing will change for any visitor and you have both sites clean separated.
If the 2nd is a clone you might needto re-clone the files but as long as you use the same database credentials on that clone (save the config file) and same albums also nothing will be harmed.
It is really that simple.
I couldn't figure out how to put the main domain name in a directory without it to appear in the adress bar so I just left it like it in the root, but site2.com works fine now.
Thanks again.
(yeah, it's a long way til' the top if you wanna rock'n'roll)
It is really this simple and your host for sure has a domain management tool for it:
www.site1.com -> site1 folder
www.site2.com -> site2 folder
http://www.site1.com/site1 folder instead of http://www.site1.com/
Thank you anyway.
I've read many things on this forum and others and tried many things too these days about that, but I still got a problem.
With this .htaccess on the root folder :
`
RewriteEngine On
RewriteRule ^$ zpdirectory/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ zpdirectory/$1
`
The ZPdirectory doesn't appear in the URL when I type www.mysite1.com but it still appears in the URL navigating through albums and images.
I've updated to Zenphoto 1.4.5.7.
I've re-run setup, refreshed the database, cleaned the html cache, even tried some exoctic stuffs with zenphoto.cfg.php but the subfolder still appears in the URL.
Did I really miss something in order to hide that damned subfolder in the URL ?
Do I have to change something manually in the parameters, in the root .htaccess or in the /ZPdirectory/ .htaccess ?
There are loads of instructions like
http://webdesign.about.com/od/mod_rewrite/qt/site_redirects.htm
Rewrite rules simply change links, so you could have a rule in domain1 that redirects to domain2. Or you can have a link that redirects domain1 to domain1/folder. Neither of these is what you are asking for.
So, contact your host and find out how to setup "subdomains" for your site. If you have a reasonable hoster that will be quite simple and allow you to have things like:
www.sbillard.org
testalbum.sbillard.org
testalbum-2.sbillard.org
that all point to "root level" Zenphoto installs.
I will mention again that I do not understand why you are so unwilling to follow our advice. But rest assured, this is the end of this discussion.