Forum Moderators: phranque
RewriteCond $1 !^(support|about-us|memorial-website-specials|profile|support|features|videos|newserver|terms-of-service|about-us|funeralnotice|signup|media|includes|modules|cgi-bin|templates|xmlrpc|language|libraries|plugins|administrator|component|images|dev|data)
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([a-z0-9\-]+)/[^\ ]*\ HTTP/
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule ^([a-z0-9\-]+)/(.*)$ https://$1.example.com/$2 [R=301,L]
it doesn't revert to
www.example.com/firstnamelastname/blahblah firstnamelastname.example.com/blahblah ^([A-Za-z]+)/ I am basically trying to ... rewrite all urls that are like so: [example.com...] to [firstnamelastname.example.com<...]
Please stop saying "rewrite". Your goal is a redirect. Doesn't matter whether it's achieved by mod_rewrite, mod_alias or some other means; all that matters is the server sends out a 301 response.
It's not clear to me whether your redirects are taking place. When you request (type into your browser's address bar)
example.com/johnsmith/more-stuff-here
does the address bar end up saying
johnsmith.example.com/more-stuff-here
or
example.com/johnsmith/more-stuff-here
or something else entirely?
If the redirect is not taking place: Do you have other RewriteRules that work as intended?
:: wandering off to compose boilerplate on Things To Check Before Calling The Repairman ::
RewriteCond $1 !^(terms-of-service|about-us|signup|media|includes|modules|cgi-bin|templates|xmlrpc|language|libraries|plugins|administrator|component|images|dev|data)
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([a-z0-9\-]+)/[^\ ]*\ HTTP/
^[a-z]+/etcetera RewriteCond %{THE_REQUEST} ^[A-Z]+ /([a-z0-9\-]+)/[^\ ]*\ HTTP/
RewriteCond %{HTTP_HOST} ^([a-z0-9\-]+)\.example\.com
RewriteCond %1 !^www\.
RewriteRule ^(support|about-us|terms-of-service|signup|component|includes|media|cgi-bin|templates|xmlrpc|language|modules|libraries|plugins|administrator|images(/.*))$ [example.com...] [R=301,L]
RewriteCond %{HTTP_HOST} ^[a-z]{4,}\.example\.com RewriteRule ^((foo|bar|here|there|more|stuff)(/.*)?)$ etcetera # Externally redirect all www hostnames to non-www hostnamesRewriteCond %{HTTP_HOST} ^(([a-z0-9\-]+\.)*)www\.(([a-z0-9\-]+\.)*)example\.com
RewriteRule ^(.*)$ https://%1%3example.com/$1 [R=301,L]
sub1.sub2.www.sub3.sub4.example.com