I have multiple very similar drupal sites (each for a specific year of some project): 2012.somain.tld, 2013.domain.tld, etc. Their files are organized in subdirectories (2012, 2013, etc.) of public_html directory of my hosting.

I'm trying to make them all work via .htaccess settings. I write the following code for every site:

RewriteEngine on 
RewriteBase / 
RewriteCond %{HTTP_HOST} ^2013\.domain\.tld$ 
RewriteCond %{REQUEST_URI} !/2013/ 
RewriteRule ^(.*)$ /2013/$1 [L]

The sites then open and at first everything seems fine, but then I realize that all URLs within site contain the subfolder name. What used to be http://2013.domain.tld/news/123 now http://2013.domain.tld/2013/news/123. And Drupal thinks that it is in the subdirectory and makes all paths reative to it.

What can I do to make things work properly, without this /2013/ in every URL?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.