Redirecting "mydomain.com/anything" to "www.mydomain.com/anything"
-
My home page is located on “https://www.mydomain.com/home/” so i also have redirected “https://www.mydomain.com” to “https://www.mydomain.com/home/“. I’m having a site called “https://www.mydomain.com/mysite/” but if users want to visit this site by typing the url without “www” that means “mydomain.com/mysite/“, the page automatically redirects to the home page “https://www.mydomain.com/home/“.
I guess the problem can be fixed by editing the .htaccess file. but don’t have any idea regarding this issue!
Here is my .htaccess code:
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] RewriteRule . index.php [L]
Any idea?
- The topic ‘Redirecting "mydomain.com/anything" to "www.mydomain.com/anything"’ is closed to new replies.