Support » Fixing WordPress » Redirect from WWW

  • OK so.. I’m going to try my best to explain what I mean to do here.

    I want it so that if you type http://www.dont-stay.com it will take you to just dont-stay.com, not http://www.dont-stay.com. The reason for doing this is because, especially on my blog, my edit buttons and such for wordpress only show up if its without the www and not with it. I have this in my .htaccess:

    RewriteCond %{HTTP_HOST} !^dont-stay.com [NC]
    RewriteRule ^(.*)$ http://dont-stay.com%{REQUEST_URI} [R=301]

    Buuut for some reason after I removed my permalink structure, its no longer working! It worked perfectly fine for months, then just the other day it STOPPED working. What am I doing wrong??

    That code above is the ONLY thing I have in my .htaccess file, nothing else

    Other information that may help..

    My blog is at /herwords
    When you access just the domain I have a .htaccess redirect set up to bring you to /herwords. The redirect is set up WITHOUT the www. Yet when I go to dont-stay.com it brings me to http://www.dont-stay.com/herwords and before it wouldn’t have the www, but now it does!

    I have the htaccess redirect set up in my root folder AND in my wordpress configuration I have the URLs to both my blog AND the WP files set WITHOUT the www.

    The reason I want to do this is because when I visit my site WITH the www, I don’t see any edit links on my posts eventhough I am logged in.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Im not sure how to do it with wordpress.. but I have done it in my apache virtual host listing.

    Thread Starter p5hng

    (@p5hng)

    The only reason I ask here is because I’d originally read how to do it the first time here on the forums, but now I can’t find the post lol

    Thread Starter p5hng

    (@p5hng)

    I just wanted to add that after some research on my own I discovered I left out a piece of code:

    RewriteEngine On

    So after adding that before the other two lines in my .htaccess file I was able to fix the problem 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect from WWW’ is closed to new replies.