• anderslund78

    (@anderslund78)


    Hi,

    I have a website (http://koereskole-svendborg.dk/) – as default it did not have www in front og the url and I tested some different htacces such the one below with no succes. I did not change any setting in WordPress where it is set to not have www in front on the urls.

    After testing the htacces below in put in the original htacces – see below. But now I cant login on my wordpress installation anymore – what do I do to login and to solve the htacces issue?

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

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

    # END WordPress

Viewing 6 replies - 1 through 6 (of 6 total)
  • GioV1195

    (@giov1195)

    Try downloading a fresh install of WordPress, unzip it and upload a fresh copy of the .htaccess file to the root of your server.

    If you want to have the www on your URL, just go to Settings -> General and add “www.” (without quotation marks) to the beginning of your URL.

    GioV1195

    (@giov1195)

    Whoops. Turns out you can’t get a fresh .htaccess, but here’s how the default one looks like:

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

    # END WordPress

    Thread Starter anderslund78

    (@anderslund78)

    Hi,

    If you read my post I have gone back to the original htaccess text which you also posted. I am confused – how do I solve this?

    Check something like that:

    RewriteCond %{HTTP_HOST} ^www.koereskole-svendborg.dk$ [NC]
    RewriteRule ^(.*)$ http://koereskole-svendborg.dk/$1 [R=301,L]

    Mark Ratledge

    (@songdogtech)

    You don’t need .htaccess rules to remove www from the URL. Remove the www in Dashboard>>Settings and in .htaccess, remove the rewrite rules that remove the www.

    Thread Starter anderslund78

    (@anderslund78)

    Hi,

    This htacces text below works for me but the sub-pages get an 404 error. And I cant login to my wordpress installation with this text or the original htaccess text – anyone can help me to be able to login again. Do I need to change anything in phpMyadmin?

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.koereskole-svendborg.dk [NC]
    RewriteRule ^(.*)$ http://koereskole-svendborg.dk/$1 [R=301,nc]

    Songdogtech – could you provide the htacces text for this. I will try this solution when I hopefully soon can login again 🙂 the www has been in removed in the wordpress settings all the time.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Changed in htacces and now cant log in’ is closed to new replies.