Hi again Richard,
Sorry for reviving an old thread, but this is directly related to the setup that you helped me out so much with before. It seems I overlooked one aspect of the setup that doesn't seem to be working. We've established that when I user goes to:
test.sites.example.com/cms/
they are redirected to a static location (shared code) directly to the index.php file:
/usr/local/staff/code/cms/index.php
The problem I'm noticing now is that it seems like Apache is not by default using DirectoryIndex settings for normal directories in the users docroot.
This is the 'test' users docroot:
- Code: Select all
/data/sites/sites.example.com/htdocs/clients/test/
In that directory, I unpack wordpress into the blog/ directory. I should be able to now access it from:
- Code: Select all
http://test.sites.example.com/blog
However I get a 403 error, and in the logs it says:
- Code: Select all
Directory index forbidden by Options directive: /data/sites/sites.example.com/htdocs/clients/test/blog/
I actually don't want a directory index (listing of files) i just want it to execute the index.php, or any other file I have listed in the DirectoryIndex directive. If I specify index.php at the end of the URL, it seems to call it, but then comes back with the same 403 error, as if somewhere in the code it's trying to refer to itself without the statically specificaly index.php at the end. (it shouldn't have to).
Basically, any files/directories the user puts in their docroot i want to behave like normal... ie. if they end a URL in a directory name, the index file is executed, etc.
I hope I'm explaining the situation correctly. Here is my relevant apache conf (which you helped me with previously):
- Code: Select all
<VirtualHost *:80>
ServerName sites.example.com:80
ServerAlias *.sites.example.com:80
ServerAdmin webmaster@example.com
DocumentRoot /data/sites/sites.example.com/htdocs
ErrorLog logs/sites.example.com-error_log
CustomLog logs/sites.example.com-access_log common
DirectoryIndex index.php index.html index.cgi
AliasMatch ^/clients/[^/]+/(index\.php)?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/index.php"
AliasMatch ^/clients/[^/]+/(confirmation\.php)$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/confirmation.php"
AliasMatch ^/clients/[^/]+/(contact\.php)$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/contact.php"
#AliasMatch ^/clients/[^/]+/cms(/(.*))?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/cms/$2"
AliasMatch ^/clients/[^/]+/cms/?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/cms/index.php"
AliasMatch ^/clients/[^/]+/cms/(.+)?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/cms/$1"
AliasMatch ^/clients/[^/]+/flash(/(.*))?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/flash/$2"
AliasMatch ^/clients/[^/]+/html(/(.*))?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/html/$2"
AliasMatch ^/clients/[^/]+/slideshow(/(.*))?$ "/usr/local/staff/cmd/cmd/trunk/cmdv3/slideshow/$2"
Options +FollowSymlinks Indexes ExecCGI
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?sites\.example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(.+)\.sites\.example\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/clients/%1%{REQUEST_URI}/ -d
RewriteRule ^/.*[^/]$ http://%{HTTP_HOST}$0/index.php [R=301,L]
#RewriteRule ^clients/([^/]+)/(.*)$ http://%{HTTP_HOST}/$2index.php [L,R]
RewriteCond %{HTTP_HOST} !^(www\.)?sites\.example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(.+)\.sites\.example\.com$ [NC]
RewriteRule ^/.*$ /clients/%1$0 [QSA,E=CMD_SITE:%1,PT,L]
</VirtualHost>
I really would appreciate any help you can offer on this. I've tried a number of things with no luck and these rewrite rules and alias rexeps are a bit beyond my grasp
Thanks,
nick