juanvp Posted May 13, 2024 Posted May 13, 2024 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. Quote
Ookma-Kyi Posted May 13, 2024 Posted May 13, 2024 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. 1 Quote
juanvp Posted May 13, 2024 Author Posted May 13, 2024 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. Quote
juanvp Posted May 13, 2024 Author Posted May 13, 2024 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.