On my host my ZP install lives in `public/www/`
I have set up subdomains like `public/fr/`, `public/nl/` etc.
My host does not allow me to point the subdomains to my ZP install so I put an .htaccess file in the `public/fr/` folder like this:
`
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^fr\.
RewriteCond %{REQUEST_URI} !^/fr
RewriteRule ^(.*)$
http://domain.com/fr_FR/$1 [P,L]
`
But I get a 404, Not Found.
Even when I do `RewriteRule ^(.*)$
http://domain.com/$1 [P,L]` I get a 400 "Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit."
Maybe the mod_proxy is not enabled?
I need to use the P flag because the subdomains are outside the /www/ folder
Any help greatly appreciated!
.htaccess and rewrite rules drive me crazy everytime!
Comments
Linking to `http://domain.com/fr_FR/` style links will not solve the problem with multilingual content as we widely discussed actually.
Unfortunately I can NOT define them to point to the ZP install. I can only them with files in the `public/fr/` folder, so I have put this .htaccess file to rewrite http://fr.domain.com to http://domain.com/fr_FR/
Doing like this the user and search engines see http://fr.domain.com but the content from http://domain.com/fr_FR/ is served... unless I am not seeing that correctly?
But I am wondering now, I tested sbillard's 9290 changeset on localhost with ZP version 1.4.2.1 [9138] just by adding the 2 lines in zp-core/functions-i18n.php and it seems to work fine?!
Why are you saying linking to http://domain.com/fr_FR/ will not resolve the issue?
http://domain.com/fr_FR/ will not help as that url will not be static. It will be used to switch the url but that's all. The reason for the subdomain change, which will also switch languages, is to get separate addresse for each language content without JS and such. If that would do the trick all the talk and trying with the subdomains would not have been necessary at all (unless sbillard changed something else I lost track with).
Btw you should NEVER just apply a few line change to an older release. The actual subdomain change involves a few more than that as changes in some plugins like sitemap, html_meta_tags etc.
I understand http://domain.com/fr_FR/ is not static, but http://fr.domain.com is and that's what I rewrite for. It will only serve the content of http://domain.com/fr_FR/ and thus change the language, unless I really don't get it..
OK I understand I should not just change files to an older release, I just want to prepare my subdomains on the production site when 1.4.3 get's released :-)
My problem now is how to set up the subdomains to switch the language.
a request is made for fr.domain.com
fr.domain.com serves the content of domain.com/fr_FR/ with mod_rewrite
content of domain.com/fr_FR/ switches the language to FR
fr.domain.com uses the language FR
we are on domain.com/news/
the language switch url is fr.domain.com/news/
fr.domain.com/news/ serves the content of domain.com/fr_FR/news/ with mod_rewrite
content of domain.com/fr_FR/news/ switches the language to FR
fr.domain.com/news/ uses the language FR
we are on fr.domain.com/news/
the language switch url is nl.domain.com/news/
nl.domain.com/news/ serves the content of domain.com/nl_NL/news/ with mod_rewrite
content of domain.com/nl_NL/news/ switches the language to NL
nl.domain.com/news/ uses the language NL
Try something like
`
RewriteEngine on
RewriteCond %{HTTP_HOST} ^m\.example\.com$
RewriteRule ^ http://example.com/m%{REQUEST_URI} [L,P]
`
`m` would be the `fr` repectivly the `fr_FR` in the last line.
So if your site is installed in `localpath/zenphoto/` you would have a domain, `mydomain.com` which points to `localpath/zenphoto/` and subdomains for your languages, e.g. `fr.mydomain.com`, `es.mydomain.com` which point to `localpath/zenphoto` as well. You would select the your primary language in the general options. `mydomain.com` would render in that language. `fr.mydomain.com` would render in French, `es.mydomain.com` would render in Spanish.
If your host indeed does not allow you to pick a specific folder for the subdomain then you will not be able to use this strategy. But if that is really the case you should ask them why.
Even symlinks in the subfolders are not allowed.
I asked them and they said it's not supported on their shared hosts, upgrade to dedicated blahblah.
They said
Usually when a company thinks it knows better what I want to do than I do I will find a replacement company. Maybe you should look into a different provider.
it will create links in the form /language/normal link
I really need multi language indexing. Multi language support is one of my first priorities and that's also why I found ZP!
But Could you explain that a little more? ZP wil only see the primary domain?
Why is that? Why can't I seem to use .htaccess files in the subdomain folders?
My structure is like this:
subdomains:
`
/public/fr/
/public/fr/.htaccess
`
ZP install:
`
/public/www/
/public/www/.htaccess
/public/www/index.php
...
`
Again, the P (proxy) flag in my RewriteRule in `/public/fr/.htaccess` should take care of the subdomain not being in the same vhost. But I suspect my host not to have mod_proxy enabled!! Waiting - again - for an answser to that question, and time flies by.
You know this is a very respected European group. But I am getting tired of the "x feature is currently not supported on our shared hosting, please upgrade..."
I am seriously thinking about switching to my old host...
If the domain.com/language/contents approach will become supported in ZP that would rock!!
I will donate the money that will save me switching hosts and transferring the domain, word!
The domain.com/language/contents will likely be supported. But it will need considerable debugging to be sure that nothing is missed (that is where you can help.) So long as all problems end up fixable the feature will be supported.
But be aware that it does require Zenphoto to do a full redirect for each page requested. That is why the language.domain approach is prefered.