I've created a subdomain blog.example.co.uk
to point to a folder /blog in my root directory.. The folder blog has a subfolder /php which contain scripts that talk to my server eg login, logout. This is my current structure;
root --> /blog --> /php
This is the rule that creates my subdomain
### Blog subdomain
RewriteCond %{HTTP_HOST} ^blog\.example\.co.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/blog/ [NC]
RewriteRule ^(.*)$ /blog/$1 [L]
The problem now is that files in /blog folder can't see files in /php. I also get a file not found when I try the below;
http://blog.example.co.uk/php/login.php
How can I expose these files and be able to access them with the link above. I know I have to create a new rule just don't know how.
To access the scripts I have to point to below;
http://blog.example.co.uk/blog/php/login.php
I also want to exclude the php folder from any rewrites, I'm using the below but it doesn't work for the folder;
RewriteRule ^(/blog/php)($|/) - [L]
Thanks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.domain\.com$ [NC]
RewriteCond %{THE_REQUEST} /blog/php/([^\s]+) [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{DOCUMENT_ROOT}/blog/php/$1 -f
RewriteRule ^(.*)$ /blog/php/$1 [NC,L]