Website works without www prefix

3 replies
  • WEB DESIGN
  • |
I am working on IIS for the first time, but my website is php, but i dont think the issue is within php, because:

if i enter: thevietnamtourism.com it works fine.

but if i enter: www.thevietnamtourism.com it returns "File not found"

The cname record already exists.
#prefix #website #works #www
  • Nope. Everything works fine
    {{ DiscussionBoard.errors[10613218].message }}
  • I'd not recommend running/testing php websites using IIS. You may use XAMPP:

    https://www.apachefriends.org/index.html
    Signature
    [ Pure SSD ][ Shared, Reseller, Dedicated Server Hosting ] - [ MECHANICWEB.COM ]
    [ LiteSpeed | CloudLinux | MariaDB | cPanel | Malware Scan | Softaculous | SpamExperts ]
    {{ DiscussionBoard.errors[10613427].message }}
  • Profile picture of the author samthesin
    Please make you have only one website. Right now you have two.
    www.thevietnamtourism.com
    and
    thevietnamtourism.com

    You need to create redirect in htaccess file to have only one. Please choose one of codes below.

    Code:
    #Force www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
    Code:
    #Force non-www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www.example.com [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
    {{ DiscussionBoard.errors[10613870].message }}

Trending Topics