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
0
votes
1 answer

In IIS, how can I forward all my URLs to a non-www, https, and no file extension without having too many redirects

I have gone through many similar questions in Stack Overflow, but I have not been able to find one that helps me to have all three of these re-direct rules work together. I am trying to forward all of my URLs to this…
Klay
  • 183
  • 5
  • 12
0
votes
0 answers

Non-www htaccess redirect only works on the home page

I'm having trouble redirecting the www requests to non-www on my Wordpress-based site. The code I used works fine on the homepage, but not on any sub pages. I'm using the following code taken from this question: RewriteEngine On RewriteBase…
PeterInvincible
  • 2,230
  • 5
  • 34
  • 62
0
votes
0 answers

how to get full host name from a partial string in php

I have a the following URL:google.com. I need to know if the full hostname consists www, or a function that will give me the full hostname (IE. www.google.com) I want to get the full host-name and i cannot always add www as a prefix (IE. if i have…
Ori Price
  • 3,593
  • 2
  • 22
  • 37
0
votes
3 answers

WP https redirect causes loop error

My Wordpress site's URL is set to HTTPS in the WP settings. If you type domain.com, it redirects to www.domain.com. If you click on the logo, it'll take you to https:/www.domain.com. I'd like https to be enabled by default on all pages. I tried…
Mr.988
  • 1
  • 2
0
votes
1 answer

redirect non-www to www resulting in loop address

I'm configuring my website to redirect any non-www to www, but resulting in address loop like this: abc.com/www.abc.com/index.php/www.abc.com/index.php/www.abc.com/index.php/www.abc.com/index.php/www.abc.com/index.php ... and so on Below is my…
yodann
  • 355
  • 5
  • 20
0
votes
1 answer

apache redirect to naked (non-www) domain messes up pages handler

all the urls in my website actually go through a PHP page that handles them by the page GET parameter (i.e. domain.com/sub/test is actually domain.com/page_handler.php?page=sub/test). files or directories that exist don't go through the…
Imashcha
  • 314
  • 1
  • 9
0
votes
1 answer

How can i set iis 7 to get access to the site with www?

I tried to set up the site settings in order to access it with or without www with no success. I only can acces it without www. (http://mywebsite.com). The IIS 7 is running on a windows web server 2008. Any idea how to solve it?
0
votes
1 answer

How to redirect www to no-www on OpenShift properly?

I have an OpenShift Python app running on 730ne.cz and www.730ne.cz and I want the www version to redirect to the non-www. I've added wsgi/.htaccess with the following content: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$…
hroncok
  • 1,147
  • 8
  • 12
0
votes
2 answers

Redirect non-www to www without specifying domain name

I have a lot of websites using the same version of an htaccess file and I need to redirect all non-www to www using the same rule without specifying the domain name. The rule that does what I require is # Rewrite non www to www RewriteCond…
Alex
  • 1,060
  • 2
  • 17
  • 35
0
votes
1 answer

How to redirect non-www to www using htaccess?

I'm trying to do a htaccess redirect from the non-WWW url to the WWW url. I saw alot of example in this forum like: Redirect non-www to www in .htaccess but none of them work like I want. My url is: www.evo.co.il and a page in my site for example is…
itay
  • 357
  • 4
  • 16
0
votes
1 answer

apache 2 WWW redirection issue

This is my /etc/apache2/sites-availables/mysite.com file configuration ServerAdmin LOLILOL@LOL.com ServerName www.example.com Redirect permanent / http://www.example.com/ ServerAlias example.com DocumentRoot /home/example/www SuexecUserGroup…
0
votes
1 answer

www to non www in .htaccess where subdomain already exists

I have found loads of examples of rewrite rules for non www to www but i am just looking to check what the practice is for allowing www. redirects when subdomain already exists... So let's say i want to enable people to…
CraigF14
  • 3
  • 2
0
votes
2 answers

Website requires www. prefix?

This isn't really code related, but at the same time it seems like the right place to ask. It's not happened to me for a while but a friend mentioned it in conversation earlier and now I need to know because it's bugging me!! There are certain…
Nick
  • 2,261
  • 5
  • 33
  • 65
0
votes
2 answers

adding www to domain without reset it back to base

Hi I am trying to do a redirect from non wwww to www I am using the code below RewriteEngine On RewriteCond %{HTTP_HOST} ^basedomain\.com$ [NC] RewriteRule ^/(.*)$ www.basedomain.com/$1 [L,R=301] this works fine except it resets everything back to…
user1920187
  • 802
  • 1
  • 7
  • 15
0
votes
2 answers

How to force www. with .htaccess?

I have looked around and no one seems to be experiencing the same problem as me. I have used: RewriteEngine on RewriteCond %{HTTP_HOST} ^yoursite.com [NC] RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L] However when I navigate to…
joshkrz
  • 499
  • 3
  • 7
  • 25