• Resolved WPtesting

    (@wptesting)


    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?

Viewing 4 replies - 16 through 19 (of 19 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    WordPress not being able to redirect non-www to www of a domain is … well it depends on WHAT error you’re getting.

    That it’s defaulting to the front page is indicative of your DNS being buggered.

    Thread Starter WPtesting

    (@wptesting)

    Finally Fixed the problem! by adding a CNAME record called https://www.mydomain … Still I’m out of logic! but working fine…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Okay, so it was DNS. The explicit call was required.

    Thread Starter WPtesting

    (@wptesting)

    Still I’m not sure whether it was DNS or not. Coz the everything was working fine, except WP. And fixing such a problem by adding a CNAME called www-dot-domain-name is really wired to me!

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Redirecting "mydomain.com/anything" to "www.mydomain.com/anything"’ is closed to new replies.