0

I am having basic workflow problem in creating translated website in Drupal 7. A site was handed to me which was already live(lets say www.mywebsite.com). It is having two languages already (English-www.mywebsite.com and Finnish-www.mywebsite.fi).

Now I need to add new language translation(Swedish). www.mywebsite.se already point to old D6 site (www.oldmywebsite.se). Also in language interface(admin/config/regional/language) Swedish domain entered is old one(i.e. www.oldmywebsite.se) to help visitor still access old site.

Question: So how can I create new Swedish dev site, something like se.www.mywebsite.com which will be hidden from public but I can still work on translations and it will later replace old Swedish site. Which modules to use or what I need to do at Drupal and domain level?

I have not worked on any translation setup before so I am feeling completely lost. Any help will be appreciated.

Summary :

www.mywebsite.com      :   new English
www.mywebsite.fi       :   new Finnish
www.oldmywebsite.se    :   old Swedish site

se.www.mywebsite.com   :   Want to create dev Swedish site which will later replace old swedish site
1

One option would be to password-protect your dev site; I've been doing this with a test subdomain for a while. You want to add something like this to the beginning of your Drupal .htaccess file:

AuthUserFile /path/to/.htpasswd
AuthName "Development Site"
AuthType Basic

# Change the below to match your actual domain.
SetEnvIfNoCase host se\.www\.mywebsite\.com is_dev

Order deny,allow
Deny from all
Allow from env=!is_dev
Require valid-user
Satisfy Any

You can refer to this if you're unfamiliar with .htaccess password protection or how to generate a .htpasswd file. Anyone who attempts to access the submdomain you have under development will be prompted by the server (Drupal need not get involved) to enter a username and password before they continue.

This could cause conflicts if you have any existing .htaccess-based allow/deny restrictions on your site or any portion of it, but should not conflict with the security restrictions Drupal has later in its default .htaccess file, and it definitely won't interfere with any Drupal modules that restrict access at the PHP/session level.

And as always when editing Drupal's .htaccess, make sure you back up the file and/or copy the changes over whenever you update Drupal core, because odds are it will be overwritten.

2

As long as you do not add se.www.mywebsite.com to the DNS nobody will find it. You locally can add se.www.mywebsite.com to your hosts file and point it to a IP (maybe your localhost). When ready to be launched you can add a pointer from se.www.mywebsite.com to the IP of the production server.

  • I like your solution also, too bad can't flag two answers as solutions. Thanks alot!! – rockvilla Aug 1 '13 at 5:50
  • Great. Glad you got it worked out. – Pontus Nilsson Aug 1 '13 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.