I'm using domain access module in my website and have multiple domains in my website. For example I have the domains
test.example.com (primary domain)
test1.example.com
When I create a sample content "Contact" and provide it with the URL alias as 'contact' (assume node id as 143), Under domain access options I select "send to all affiliates". When I try to access the below url
test.example.com/contact (its working fine)
test1.example.com/contact (page not found)
But both of these below are working
test.example.com/node/143
test1.example.com/node/143
Is it possible to have the same URL alias for all the domains. I used domain path module and its not working as needed.
Thanks.
In Drupal 7, what happened to me was, each domain had its own language. I'd turned off multi-lingual support on the content types thinking, "if I select the domain I want the content to appear on, it will default to the domain's language". Wrong!
I found that each node was picking up the default language from /admin/config/regional/language . In this case English. The node's language wasn't displayed anywhere, so I missed it. When I tried to view a page assigned to a French URL, clean URLs just won't work. I could access via the /node/nnn, but not the clean URL.
You need to :
edit the content type
in 'Publishing options', 'Multilingual support' set that to enabled.
save
edit the content type again
go to "Manage Display"
'Language' field, set the 'Format' for that to 'Hidden'
save
each each node and either set the language to the domains default OR set to 'Language neutral'
Then sit back and watch those URLs work :-)
Related
Have a multilanguage app and i want the admin to be able to specify the "default website built language".
For this ive created a table with language entries that the admin can choose from. Users can then choose the language they want the app in, which ive done with I18n::setLocale(...) in AppController.
The problem is that if the main language the admin sets the site to, does not match config/app.php App.defaultLocale, the app will try to save content in the translation table instead of the main table.
Ive tried using ini_set('intl.default_locale',..) in the boostrap.php, as well as Configure::write('App.defaultLocale',..); and none of them seem to work, however if I alter config/app.php to the desired language specified by the admin the app behaves as expected.
My goal is to specify at runtime the app language so that the behavior matches config/app.php without the need of changing the app.php config file.
We do it this way in AppController:
$locale = ... get locale from URL, session, cookie, database etc.
I18n::setLocale($locale);
CakeTime::setDefaultLocale($locale);
I have a domain name purchased via google domains. I want to point it to my app engine instance. In the "custom domains" settings tab in the app engine console, I have the following:
I want both the "bare" and "www" flavors to point to my app engine instance:
http://example.com
http://www.example.com
I'm not sure which option to use for step #2 to get that to work?
Thanks
You'd be following the Adding a custom domain for your application procedure, with focus on section 4:
4. Continue to the next step the Add new custom domain form, selecting the custom domain you want to point to your App Engine app:
a. Refresh the console domain page so it will list the domains properly.
b. If you want to use a subdomain, such as www, use the second option (http://www.example.com).
c. If you want to use a naked domain, use the first option to specify a naked domain (such as http://example.com).
d. Click Add to create the desired mapping.
You need to specifically add both the naked domain and the www subdomain, explicitly, by running the entire section 4 twice, once selecting 4c and once selecting 4b, respectively.
To do that at step #2 (in the Add a custom domain screen illustrated in your image) you first select the 1st radiobutton, for http://example.com and click Add. Unfortunately you don't see this addition displayed anywhere in the developer console (AFAIK). When the custom domain config was done through Google Apps the naked domain was visible explicitly, but that's no longer available.
Then come back at the Add a custom domain screen and at step #2 select the 2nd radiobutton, fill in www in the text input area (if needed), select example.com from the dropdown list (if needed) and click Add. This adddition should cause a new entry to be listed in the Custom Domain main screen (the parent screen), with a www.example.com Custom domain name and a www Alias.
This should be all (it may take a while for the DNS changes to propagate to your machine so that you can verify the effects, the doc mentions up to 24h).
I've set up a custom domain with Appengine.
The domain currently works as http://example.com (naked domain) but it throws a "This webpage is not available" error with http://www.example.com
Any idea how could I get the 'www' subdomain working? Would it be possible to fix it by adding/changing the DNS records (CNAME, TXT)?
The procedure is as follows:
Navigate to
https://console.developers.google.com/project/yourapp/appengine/settings/domains,
having replaced "yourapp" with your project name.
Click "Add custom Domain"
Go to the 2nd section (it will say "Select the domain you want to point to yourapp").
In that section, select the 2nd field, fill in "www" and select the domain in the dropdown.
Log in to your DNS management dashboard (this could be godaddy.com, namecheap.com, etc).
Add a CNAME record with your DNS host, as follows: alias: "www", address (canonical name): ghs.googlehosted.com, and save.
Give it a few minutes, and www.yoursite.com should now take you to your app (should be the same that can be found at yourapp.appspot.com).
Assumptions I made:
That you wish to point the DNS record to the default module of your AppEngine project. Please leave a comment if you wish 'www' to point to a different module.
That you have already registered your domain with Google and have a TXT DNS record there, proving your ownership of the domain to Google.
I want my Drupal site to be divided:
/uk/en
/uk/fr
/us/en
/us/es
Based on this advice, I was told to use this. The problem is, the module has no configuration page, nor does it have a README. I have scanned the code and it's not immediately apparent how to use it with the Domain Module.
Anybody been able to use this and get it working as described above?
Multilingual support is provided by the Locale core module. To add a new locale(country/language combination) enable the Locale module.
Go to Home » Administration » Configuration » Regional and language » Languages
and add the new locales you need.
Specifically Path prefix language code value will be used to build the url.
Country Path module extends domain access module. You do not have to configure anything except checking 'country path' in 'configuration->languages->detection and selection'. The country suffix will be added automatically based on the country domain selected in your domain record.
Example: I had created three domain records for india australia and singapore with the same URL and was able to access all the three by prefixing /in /au and /sg respectively
This is what I need to do:
I'm creating a site in CakePHP where I need to show different stuff (logo, pictures, etc) depending on what sub-domain the user has used to get to my site. For example: let's say there are 3 sub-domains:
subdomain1.mydomain.com
subdomain2.mydomain.com
subdomain3.mydomain.com
All three sub-domains will point to the same folder in the server where my CakePHP app is. I would like to know how can I get the sub-domain used by the user so I can show different things depending on that.
I don't know if this can affect my question, but there's one more thing. The users won't actually use the sub-domain links. They will use other domains that redirect to the sud-domains. For example, a user will enter www.whateverdomain1.com and he will be redirected to subdomain1.mydomain.com. However, I've been told that the user won't actually see the redirection, he will always see the www.whateversomain1.com that he used.
Any ideas? Thanks so much in advance!
The easiest way I can think would be to have your webserver redirect requests from sub.domain.com to domain.com/sub, and from there using the route configuration.
In the route configuration - you have two options, either to use prefixes (http://book.cakephp.org/view/945/Routes-Configuration#Prefix-Routing-950) or setting up named parameters:
Router::connect(':subdomain/:controller/:action/:id', array('id' => '[0-9]+'));
And in your controllers you can then check via
$this->params
to see what the subdomain is and set your variables accordingly.