: How to update my website's URL in Google from www to non-www I am having trouble updating the URL of my first uploaded website that I made from scratch. I have changed the the URL and have
I am having trouble updating the URL of my first uploaded website that I made from scratch. I have changed the the URL and have submitted to Google, but when I type in the name 'example' into Google my old website URL (www.example.com/example/) is displayed with the old title and meta tags. However when I type in example.com, which is the new URL, it shows first and it's the correct website with the correct tags and title.
How can I make the old URL www.example.com/example to just example.com? I have taken out the from the new URL, would that be a problem?
More posts by @Courtney195
1 Comments
Sorted by latest first Latest Oldest Best
If you're using an apache server, you can add this to your .htaccess file:
# Enable Rewrite engine
RewriteEngine On
# Check if we're on the www subdomain
RewriteCond %{HTTP_HOST} ^www.([^.]+.[^.]+)$
# If the previous condition is true, redirect to non-www
RewriteRule ^(.*)$ %1/ [R=301,L]
The above code will redirect everything to a non-www version of your URL
More info >>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.