Questions tagged [no-www]

The process of eliminating the usage of WWW to prefix URLs.

The process of eliminating the usage of www to prefix URLs, for instance by redirecting users from http://www.example/ to http://example/. www is by many considered a dead and unnecessary practice.

256 questions
1
vote
0 answers

How To Force Redirect To Https + Non-WWW + Trailing Slash With A Single 301 Redirect?

I want all my users to be redirected to https://example.com/subfolder/ A single 301 redirect that redirects to https + non-www + trailing slash. How do I do this in htaccess?
1
vote
0 answers

Issue redirecting www to naked domain (Gitlab pages, Hugo static website, namecheap, let's encrypt)

I have currently my Hugo static website hosted on gitlab pages with Let's encrypt for the SSL certificate. Both naked and www domain are enabled in gitlab pages as well as in the DNS (namecheap). I would like to redirect www to the naked domain. I…
1
vote
3 answers

nginx www redirect to non-www throws cert error

I have added the following server declaration so that all www. prefixed requests should redirect to the non-www url. server { server_name www.spottingquotes.ca; return 301 https://spottingquotes.ca$request_uri; } This works great with the…
gwnp
  • 1,127
  • 1
  • 10
  • 35
1
vote
1 answer

Why my htaccess for no-www and https doesn't work?

I've a problem with my .htaccess file. I want to redirect no-www to www and HTTP to HTTPS. I've tried these files but they don't work... RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteRule ^(.*) http://www.example.com/$1…
Galnash
  • 76
  • 8
1
vote
1 answer

nginx: redirect to non-www including all subdomains

This question has been asked in various ways a million times. Still I can not find an answer that is generic enough to cover all cases. All I want is to remove www from any incoming URL and I want that applied to all my subdomains. Here is my nginx…
Dimitris
  • 13,480
  • 17
  • 74
  • 94
1
vote
1 answer

CodeIgniter: server name without www does not pick the correct DB config

If I go to url of http://www.example.com I get a nice redirect to http://www.example.com/site/index.php/home/main just as I want using the .htaccess file. If I cut the WWW part, meaning http://example.com then I get the following error: An Error Was…
Marius
  • 190
  • 1
  • 9
1
vote
1 answer

How to redirect www to non-www https?

I have installed https on my domain. And all this cases are available of my website: http://example.com // will be redirected to https://example.com https://example.com http://www.example.com // will be redirected to…
Martin AJ
  • 6,261
  • 8
  • 53
  • 111
1
vote
0 answers

htaccess REDIRECT https://example.com TO https://www.example.com

I'd like to redirect all the pages that I have in my site example.com into https://www.example.com/.. In my htaccess file I have this code that works only from all the http pages to https pages but doesn't work from non-www pages to www pages (shows…
Craig
  • 47
  • 1
  • 8
1
vote
0 answers

Dynamic htaccess for www or non-www and http or https

I hope that I'll explain myself in my needs. I'm trying to write a dynamic htaccess but I don't achive to understand the conditions and the rewriting rules. Here is my thing, I built a small CMS where the user will write their base url like…
1
vote
1 answer

Forcing HTTPS & NON-WWW on a subfolder with a different domain rewrites incorrectly

I already have a Wordpress website installed to /home/USER/public_html/ and the .htaccess inside the folder looks like: # BEGIN Redirect Alias Site to Specific Folder RewriteCond %{HTTP_HOST} customwebsite.com$ [NC] RewriteRule ^(.*)$…
Ryflex
  • 5,559
  • 25
  • 79
  • 148
1
vote
1 answer

Nginx server : Redirecting www, ip and non-ssl

I have been struggling with my Nginx server's .conf file. I am getting a redirection loop error while trying to redirect these urls : http://example.com http://www.example.com https://www.example.com http://11.111.11.11 https://11.111.11.11 to :…
matissev
  • 21
  • 3
1
vote
2 answers

How to redirect, using .htaccess, multiple top level domains to one top level domain without www?

I have multiple domains with different TLDs (.com, .net, .org) but what's in front of the TLD is the same. I would like to redirect the .net and .org to .com, without www: www..net, .net www..org,…
hcristea
  • 93
  • 8
1
vote
1 answer

How to configure nginx www and non-www domains

I'm following two tutorials (1 and 2) to setup two domains on my server but after many attempts, I can't figure out how to have both domains working and www redirecting to non-www. At the moment, with the same server block files and DNS Records,…
JustAnotherCoder
  • 111
  • 3
  • 11
1
vote
2 answers

Wordpress non-www to www redirects all urls to home instead that url

My all non www urls redirects to my homepage This is my htaccess RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .…
Sanjay
  • 370
  • 4
  • 9
1
vote
2 answers

Apache RewriteCond match both www and non-www

I'm trying to redirect requests made to sitemap.xml to different sitemap files based on the domain name, like mydomain.sitemap.xml or anotherdomain.sitemap.xml etc... So far I have this but it only works with non-www domains: RewriteCond…
Marco
  • 33
  • 7