Jump to content

Recommended Posts

Posted

Hello!
Excuse me. Could you help me?
For my hosted domain: Maracaibo.info, I need that any URL begining with www, to be redirected to the URL version without www. Is that possible?
The reason is that I've a small problem with some links opening in a new tab of the web browser.
Thank you for any help.

Posted
3 hours ago, juanvp said:

Hello!
Excuse me. Could you help me?
For my hosted domain: Maracaibo.info, I need that any URL begining with www, to be redirected to the URL version without www. Is that possible?
The reason is that I've a small problem with some links opening in a new tab of the web browser.
Thank you for any help.

Yes, create a .htaccess file inside your httpdocs folder and put this as it's contents:

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

Let me know how it goes.

  • Like 1
Posted

Thank you very much.

I put that code inside .htaccess, saved it and then the links we're not working, After that, I put the former code of .htaccess, saved it again and something happenned. It's just working now as it was desired, all links opening in the same Tab. That's all fine!!

Thank You again.

Posted

The complete solution was to add only these lines inside the <ifModule mod_rewrite.c> Tag:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

To an existing .htaccess file. Without deleting the former content.

For it could be useful for other people. Thank You.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...