One of my webhosts uses Apache Rewrite for (sub-) domains. Without changing anything in .htaccess and settings.php the urls looked like:
http://subdomain.website.de/subfolder_of_webroot/
That worked fine - but I wanted to get rid of "subfolder_of_webroot" part of the url. So I uncommented .htacces with "RewriteBase /subfolder_of_webroot" and in settings.php i put "$base_url = 'http://subdomain.website.de'".
But then strangly the request part of the url was cut off strangly (example from log entries):
Type page not found
Location http://subdomain.website.de/admin/people
Referrer http://subdomain.website.de/
Message ple
Severity warning
(the ple comes from people)
I could get it done by changing a RewriteRule in .htaccess to the old drupal 6 way.
# RewriteRule ^ index.php [L]
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
So can anybody tell me why .htaccess changed that way in drupal 7?
Comments
To prevent thorny URLencoding
To prevent thorny URLencoding issues, Drupal 7 no longer needs a rewrite to a query string. Instead, drupal_environment_initialize and request_path parse the requrested uri.
Make the subdirectory the webroot for the vhost in question.
thanks for your hints
i'll take a look at them.
Unluckily at this webhosting service i can not configure vhosts. It's all done by apache mod rewriting.
So i've done some testing
To use Drupal 7 on a hoster that has no vhosts but does it all by url rewriting you got to use the old Drupal 6 query rewriting in .htaccess if you don't like to have the subfolder showing up in your url:
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
To problem is in http://api.drupal.org/api/function/request_path/7
it outputs in my case:
---------
Script Name: /drupal-7/index.php
request_uri= /admin/config
Request Path: /admin/config
Base Path Length: 9
Path: fig
---------
It would by helpfull to check if the REQUEST_URI starts with the path in SCRIPT_NAME, so that you do not have to trim the $request_path at all.
That should solve issues for people with "rewrite servers".