Forum Moderators: phranque
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !^(.+)/page\.php$
RewriteRule ^(.*)\.* page.php?$1 $page = $_SERVER['QUERY_STRING']; echo file_get_contents('http://example.com/BLOG1/' . $page); #Turns the rewrite engine on.
RewriteEngine on
#Fix missing trailing slash character on folders.
RewriteRule ^ ( [^.?]+[^.?/] ) $ $1/ [R,L]
#www.domain.com and domain.com will map to the folder {root}/folder1/
RewriteCond %{HTTP_HOST} !^www\.example\.com? [NC]
RewriteCond %{REQUEST_URI} !^/blog1/
RewriteRule ^(.*) blog1/$1 [NC,L,NS] RewriteBase /
#
# Rewrite certain requests to index.php script in subdomain
RewriteCond $1 !^subdomains/
RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.domain\.tld\.?(:80)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subdomains/%1 -d
RewriteRule ^([a-z0-9/]+)$ /subdomains/%1/index.php?post=$1 [NC,L]
#
# Rewrite all others to subdomain as-is
RewriteCond $1 !^subdomains/
RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.domain\.tld\.?(:80)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subdomains/%1 -d
RewriteRule (.*) /subdomains/%1/$1 [L] example.com/blog1/category/post
example.com/category/post
What I'm looking to do is this - if a user types in example.com, I want the user to view the content in example.com/blog/ instead of the existing content in the root directory.
RewriteCond $1 !^blog/
RewriteRule ^(.*)$ /blog/$1 [L]