i have a subdomain for my blog, but i serve two different languages and as far as i know it is good for seo to put every language in a separate subdomain and because of that i made "sub-subdomain"
i wish to load my subdomain english content inside my "sub-subdomain" ( without changing the url or redirect it ), i think this will be more easier for me than make another copy of files from my subdomain to sub-subdomain
this is my code but it doesn't work, btw .. i use lightspeed server
RewriteEngine On
RewriteCond %{HTTP_HOST} ^en.blog\.example\.com [NC]
RewriteRule ^(.*)$ https://blog.example.com/en/$1 [L]
i want this ( en.blog.example.com ) to load the content of this ( blog.example.com/en/ )
and ( en.blog.example.com/backlinks ) to load the content of this ( blog.example.com/en/backlinks ) .. etc
regards
Assuming the language subdomain points to the same place that the parent hostname (ie.
blog.example.com) then...By specifying an absolute URL (ie. with scheme + hostname) in the substitution string this will implicitly trigger a 302 (temporary) redirect and the URL will change.
You need an internal rewrite instead. But you also need to avoid rewriting URLs that are already for the language subdirectory. For example:
The
RewriteRulepattern first checks that the URL-path is not already/en(or does not start/en/) and if the request is for theensubdomain rewrites the request to the/ensubdirectory.However, you would still need to prevent the user from accessing the
/ensubdirectory from theensubdomain, etc.