Pages (2): 1 2   
Member
Member
flu   16-10-2013, 15:28
#1

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 ?

Administrator
Administrator
acrylian   16-10-2013, 15:57
#2

Actually you don't need to configure anything. Both installs have their own htaccess file and the clone only shares the same base folders via symlinks.

Member
Member
flu   16-10-2013, 16:10
#3

Hi Acrylian,
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 ?

Administrator
Administrator
acrylian   16-10-2013, 17:46
#4

For better overview on the webspace I would recommend this:
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.

Member
Member
flu   16-10-2013, 17:58
#5

In fact the folders are already set and used like that and I can't change it (for production cause).
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...

Administrator
Administrator
acrylian   16-10-2013, 18:21
#6

Well, if you don't want to change it (you really could if you like), you have to redirect the url the same way either using your host's backend or a htaccess redirection. For htaccess redirections there are loads of tutorials on the net.

Member
Member
flu   16-10-2013, 18:34
#7

Acrylian, could you tell me what do I have to change in my .htaccess (on site1.com or site2.com) to make it work ?

Administrator
Member
Member
flu   16-10-2013, 19:03
#9

Well, nothing specific to Zenphoto clone option.
Sorry to have asked.

Administrator
Administrator
acrylian   16-10-2013, 19:05
#10

No, indeed, just general web stuff ;-) The only part for Zenphoto is that if you redirect a domain to /site2 the ZP htaccess of that has of course needs to be rewritebase /. But that is as with root installs since it is then one.

Member
Member
flu   17-10-2013, 15:25
#11

The installation is like that :
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 ?

Administrator
Administrator
acrylian   17-10-2013, 15:33
#12

Again it would be all easier if you would redirect the domain via your host directly to the /site2 folder.

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!

Member
Member
flu   17-10-2013, 16:46
#13

Hi,
"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).

Administrator
Administrator
acrylian   17-10-2013, 16:56
#14

So you already redirected the site2.com domain to the /site2 folder? Then you don't need to do the same using htaccess… And if you are already on the site there is nothing to redirect via that sites htaccess because that itself now redirects back to site1.com/site2 again…

You are really over complicating things here…

Member
Member
flu   17-10-2013, 18:32
#15

"You are really over complicating things here… "
That's all me... I'm giving a try right now.

Member
Member
flu   17-10-2013, 18:47
#16

Then, site2.com is still redirected to site1.com.

.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.

Administrator
Administrator
acrylian   17-10-2013, 19:27
#17

Clear your browser cache and make sure the web server setting via your host are correct. Sometimes these take some time to work.

Member
Member
sbillard   17-10-2013, 22:07
#18

I think you really need to study rewrite rules.
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.

Member
Member
flu   18-10-2013, 18:18
#19

Ok Stephen.
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" ?

Administrator
Administrator
acrylian   18-10-2013, 18:32
#20

Again, you are really overcomplicating things. As long as you have both sites under separate domains there is no change to any of the sites. Production or not.

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.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.