Hi Jd Morgan,
I have been using : #################BEGIN RULES ON LIVE SITE
# Externally redirect direct client requests for subdomain-subdirectory URLs which
# resolve to existing subdirectories back to canonical subdomain root URLs
RewriteCond $1 !^(features|terms-of-service|about-us|signup|media|includes|modules|cgi-bin|templates|xmlrpc|language|libraries|plugins|administrator|component|images)
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([a-z0-9\-]+)/[^\ ]*\ HTTP/
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule ^([a-z0-9\-]+)/(.*)$ [
$1.example.com...] [R=301,L]
#
# Externally redirect requests for /features, /about-us, /signup, /images in subdomains to main domain
RewriteCond %{HTTP_HOST} ^([a-z0-9\-]+)\.example\.com
RewriteCond %1 !^www\.
RewriteRule ^(features|about-us|terms-of-service|signup|component|includes|media|cgi-bin|templates|xmlrpc|language|modules|libraries|plugins|administrator|images(/.*))$ http://example.com/$1 [R=301,L]
#
# Externally redirect all www hostnames to non-www hostnames
RewriteCond %{HTTP_HOST} ^(([a-z0-9\-]+\.)*)www\.(([a-z0-9\-]+\.)*)example\.com
RewriteRule ^(.*)$ [
%1%3example.com...] [R=301,L]
#
I notice google is indexing my subdomains with the /index.php even though i have a rule in robots.txt to block /index.php in the subdomain and main domain.
Is there a rule that can check if there is a subdomain redirect to the subdomain such as [
one.example.com...] redirects to [
one.example.com...] only
I had this rule to redirect index.php to main domain
#RewriteCond %{THE_REQUEST} ^.*/index.php
#RewriteRule ^(.*)index.php$ http://example.com/$1 [R=301,L]
But what i need to know is to run the rule once its in a subdomain and also not redirect to something that would prevent me from going into the backend
The index.php rewrite rule above prevents me from using:
http://example.com/admin/index.php because it would redirect to
http://example.com/index.php