Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By TheGAME1264

Thread: Subdomain www to non www

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    2
    Member #
    55512

    Subdomain www to non www

    Hello,

    I made a subdomain and it works fine! But when i use www. in front the site doesn't work. I want to redirect www. to non www. I tried a lot of things in the subdomain .htacces with the help of google but i didnt find a solution.

    Anyone knows how to solve this?

    Also the subdomain can't be found on google. Today i manually added it to the google add a site page but i dont know if that's going to solve this.

    I hope you guys can help me!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    You'd need to add www.subdomain.domain.com as a DNS entry. I personally wouldn't bother. No one's going to put that into a browser.
    safavifilm likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Junior Member YacaZG's Avatar
    Join Date
    Oct 2016
    Location
    Zielona Gora / Poland
    Posts
    10
    Member #
    55393
    And this not work's?

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?redirected-domain\.com [NC]
    RewriteRule (.*) http://target-domain.com/$1 [R=301,L]

  5. #4
    Junior Member
    Join Date
    May 2016
    Location
    Bangalroe, India
    Posts
    3
    Member #
    54168
    # Begin 301
    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  6. #5
    Junior Member
    Join Date
    Jan 2017
    Location
    ahemadabad
    Posts
    9
    Member #
    55990
    Liked
    1 times
    Hi,
    you should add following code:

    # rule for forcing www on main domain
    RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # rule for removing www on sub domains
    RewriteCond %{HTTP_HOST} ^www\.([^.]+\.mydomain\.com)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]


    i hope this proper work in your website.

    Thanks,
    sonvi.belani


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com