By no2e on
I described my problem here, here and here and searched for help in IRC - but got no answers since 17 days. I want to start playing with Drupal, but can't, until I know, that it will work.
Very briefly:
I want to redirect all my sites (of my multi-site) from www. to non-www.
It works for all the multi-sites (with this code) but not for the main site (default, where Drupal is installed). I can't access this default site anymore, as soon as I use the linked code snippet in my .htaccess.
It would be okay to waive the rewrite for the default site (means: It's okay to use the www-version for the default site only, if its eases things up), but I need to access the default site.
Pleease, any help?
Comments
Addition
The default site is
http://example.com/john/drupal/and when I use the linked snippet, it redirects me tohttp://example.com/, as soon as I try to call the site with www. (so as soon as I callhttp://www.example.com/john/drupal/I have never used multi site
I have never used multi site but did you set
RewriteBase /john/drupal in your htaccess?
If you give me more examples I think I can help. Such as what are all the URLS in question.
Discount SSL Certificates http://www.RunSSL.com
Site / URL structure
Yes, while testing, I set the RewriteBase to
/john/drupal, but it didn't seem to change anything.At the moment, it's all under the same domain.
Default site (where Drupal is installed):
Multi-Sites:
It's not as fancy a
It's not as fancy a technique as what you appear to be using with that code, but in my case, I just copy/pasted multiple copies of the www/non-www related RewriteCond and RewriteRule lines in .htaccess, and changed the domain names in the second copy. Works fine for me (one site is the default site, and there is 1 multi-site).
-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides
That would be okay
That would be okay for me (don't have many multisites, so manually editing would be no problem).
Can you tell me, how exactly the snippets should look like? (I posted the site/url structure above)
And in what order I have to arrange them?
I don't know, if I have to use
or
for the default site.
----
/bump :|
I'm afraid I don't know
I'm afraid I don't know either. I haven't installed Drupal in a sub-folder since I first tried it out with Drupal 4.7, and then I didn't adjust the www/non-www settings. I only use Drupal now at the root of the domain, or as a sub-domain sometimes.
My instinct is that you don't include that full path there in the rewrite rules, but I could be wrong. My limited understanding of what Apache is doing there is it is receiving that URL, checking it against the pattern you've provided (which I believe is a regular expression), and if it matches what it's looking for, either process it a certain way, or pass it on as is.
One setting which I also have never used, but seems worth checking as well is $base_url in your sites/default/settings.php file. Check that out if you haven't already. I also have never uncommented RewriteBase in my .htaccess
Anyhow, hope this helps at least a little. Keep in mind the apache rewrite stuff is also a general hosting sort of question too, so you might get help on it as well from webhostingtalk or places like that.
Good luck.
-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides
I'm afraid I don't know
Hum, okay - thanks anyway.
I set $base_url for my default site (
http://example.com/john/drupal/) tohttp://example.com/john/drupal. I did not set it for any multi site.When I use RewriteCond
When I use
in the
.htaccessof my installation (in/john/drupal),it redirects all my multisite subdomains correctly.
But the default site only works when I call it without
www.. When I enter the URL with the www-prefix, I get redirected tohttp://example.com, but with the correct url suffixes.So let's say, I call
http://www.example.com/john/drupal/admin. I'll get redirected tohttp://example.com/adminSo I thought, it's because of the missing
RewriteBasein the.htaccess- but after setting it to/john/drupal, the Clean URLs do not work anymore for any of my multisites.