Multisite redirect issue
-
My site structure is main site “mysite” and two subfolders sites /es/ and /en/
mysite.com redirects => mysite.com/es/
What is wrong: mysite/non-existing-page redirects => mysite.com/es/
Some part of this main redirect is causing that every non-existing page inside mysite.com (This site is empty) is redirected to the main page which is in the subdomain mysite.com/es/ instead of getting a 404 error. I see where is the problem but I don’t know how to modified the ruleMy redirect in the htaccess file:
# Main Redirect RewriteEngine On RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ RewriteRule ^/?$ "https\:\/\/mysite\.com\/es\/" [R=301,L] RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ RewriteRule ^index\.html$ "https\:\/\/mysite\.com\/es\/" [R=301,L] RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ RewriteRule ^indexingles\.html$ "https\:\/\/mysite\.com\/en\/" [R=301,L]
Works perfect for the following:
Is perfect that mysite.com/ redirects => mysite.com/es
Is perfect that index.html redirects => mysite.com/es
Is perfect that indexingles.html redirects => mysite.com/enSummarizing
Every URL that has mysite.com/non-existen-page redirects to the main page: mysite.com/es/. Its a very bad thing that it doesn’t get a 404 error. I have to change this and I don’t know how .
If the URL is mysite.com/es/non-existen-page it gets a 404 error which is ok.
If the URL is mysite.com/en/non-existen-page it gets a 404 error which is ok.
Thanks in advance
The page I need help with: [log in to see the link]
- The topic ‘Multisite redirect issue’ is closed to new replies.