+ Reply to Thread
Results 1 to 5 of 5

Thread: no-www htaccess issue

  1. #1
    frankp is offline Coder frankp has a spectacular aura about frankp has a spectacular aura about
    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's Avatar
    Cormac is offline Cormac Moylan Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of
    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
    frankp is offline Coder frankp has a spectacular aura about frankp has a spectacular aura about
    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
    blacknight's Avatar
    blacknight is offline Web Slave blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    8,439
    Thanks
    21
    Thanked 17 Times in 16 Posts

  5. #5
    frankp is offline Coder frankp has a spectacular aura about frankp has a spectacular aura about
    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

+ Reply to Thread

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

www htaccess

No WWW htaccess

no www .htaccess

.htaccess no www

no www htaacessnowww htaccess www htaccesshtaccess no wwwordpress no htaccess filehtaccess rewriterule no wwwhtaccess ww to wwwno-www to www htaccesshttaccess wwwno htaccessno www rewriterulerewriterule www no-wwwno-www to www httaccessnowww htacceshttp://www.domain.com/somepage.htmwww. htaccessno-www .htaccess with vbseorewriterule no wwwno wordpress .htaccesswww .htaccess

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

Search Engine Optimization by vBSEO

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