What I’m trying to accomplish is basically hide the fact that the page is served from a subdirectory.
I currently have the following .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/blog
RewriteRule (.*) /blog/$1
This does what I want. It serves pages from /blog while giving the user the impression of being in the root directory.
However if the user visits http://www.example.com/blog they get the same page. If possible I would actually like them to get /blog/blog.
The main reason this worries me is not because of real users but because of robots that might index the page with the wrong URL.
This is possible but you have to cheat a little. Essentially THE_REQUEST never changes during rewriting so you can test for that.
http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond