Results 1 to 5 of 5

no-www htaccess issue

This is a discussion on no-www htaccess issue within the Coding Help forums, part of the Webmaster Discussion category; I wanted to get rid of the www on my site as per no-www.org so I implemented the code in ...

  1. #1
    Coder
    Join Date
    Jan 2006
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default no-www htaccess issue

    I wanted to get rid of the www on my site as per no-www.org so I implemented the code in the htaccess file as they advocate...

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
    However I ran into a problem - if someone tries to go to www.domain.com/somepage.htm for example they get sent to domain.com rather than domain.com/somepage.htm

    I can't show an example right now as I removed the edit to my htaccess file!

    Any ideas? Thanks for any help!


    Last edited by frankp; 15-03-2007 at 03:38 AM.

  2. #2
    Cormac Moylan Cormac's Avatar
    Join Date
    Jan 2006
    Location
    Cork
    Posts
    1,262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by frankp View Post

    I can't show an example right now as I removed the edit to my htaccess file!

    Can you provide us with the exact code in the .htaccess file?

  3. #3
    Coder
    Join Date
    Jan 2006
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sure - and now that I look at it I'm guessing there's a conflict with the Wordpress stuff.. but I've no idea how one would sort it out... any/all help gratefully accepted!


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

    # END WordPress

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

  4. #4
    Web Slave blacknight's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    9,670
    Thanks
    75
    Thanked 41 Times in 39 Posts

    Default

    It *might* help if you put all the rules into one block.

  5. #5
    Coder
    Join Date
    Jan 2006
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks!

    thank you - you're spot on.

    and to make matters worse - if I had added wordpress to my search I would have found this thread...

    The no-ww code has to come BEFORE the lines:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    it seems.

    Currently working htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.bifsniff\.com$ [NC]
    RewriteRule ^(.*)$ http://bifsniff.com/$1 [R=301,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

Similar Threads

  1. CSS issue
    By ph3n0m in forum Coding Help
    Replies: 11
    Last Post: 30-01-2007, 11:05 PM
  2. CSS Issue for Wordpress Menu..
    By Cormac in forum Coding Help
    Replies: 4
    Last Post: 03-12-2006, 02:12 PM
  3. No www.
    By Cormac in forum Webmaster Discussion
    Replies: 5
    Last Post: 20-10-2006, 02:33 PM
  4. WP: WYSIWYG url issue
    By Cormac in forum Blogs & Blogging
    Replies: 4
    Last Post: 01-09-2006, 09:46 AM
  5. Domain Transfer Issue
    By fieldcorbett in forum Domains and domaining
    Replies: 1
    Last Post: 03-04-2006, 06:55 PM

Visitors found this page by searching for:

htaccess no www

No WWW htaccess

www htaccess

no www .htaccess.htaccess no wwwhtaccess www or no wwwhtaccess www no wwwnowww htaccessno htaccesswww .htaccesshtaccess help with no wwwrewriterule www no wwwno .htaccessno-www htaccesswww no www htaccesshtaccess rewriterule no wwwhtaccess no ww to wwwno www htaacessrewrite rule no wwrewriterule no wwwhttp:www.irishwebmasterforum.comcoding-help1568-no-www-htaccess-issue.htmlhtaccess code missing wwwrewriterule ziel any.htaccess no www.no www php issues

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79