folks: The main site is pointed to mydomain.com I have

Hi folks:

The main site is pointed to mydomain.com I have a redirect set at the hosting provider to point http://www.mydomain.com to mydomain.com (is that the best way to do it for SEO and properly)?

Or, should I remove that and do it on WP somehow (if so, how)?

Lastly, when using http://www.mydomain.com it works good. But when I go to http://www.mydomain.com/subpage (or any page other non home page) it reverts back to http://www.mydomain.com home page only. How can I fix that?

Thanks guys.

Greg

  • aristath

    Hello there Greg,

    The main site is pointed to mydomain.com I have a redirect set at the hosting provider to point http://www.mydomain.com to mydomain.com (is that the best way to do it for SEO and properly)?

    If you're redirecting the domain, then this would also explain the other issue you're having.
    You can add the following in your .htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    and remove the redirection that you have in place and instead just add an A record to it so that it points to the same place.

    This way the http://www.domain.com/* will be rewritten to domain.com/* (without www).

    I hope that helps!
    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.