WordPress Permalink change causes frontpage 404

I recently installed the WordPress SEO plugin and the plugin requested that i changed my Permalink settings.

Now, i did this to get nicer looking links containing the postname instead of the post id.

Read More

When the change was made, i was meet by 404 Error on my frontpage.

My static page seems to work fine + the direct link(accessed via the backend) to my blogposts works as well.

But my frontpage just gives me a 404 instead of listing my posts.

Some info about my setup

My blog is placed inside a subdirectoy so its accessed like this:

www.myhomepage.com/blog/

However i also have a redirect that directs blog.myhomepage.com to www.myhomepage.com/blog/

I added this redirect in my htaccess file like this

RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.myhomepage.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.blog.myhomepage.com$
RewriteRule ^/?$ "http://www.myhomepage.com/blog" [R=301,L]

I have just tryed to remove this line from my htaccess file and the site works if this is done, but i actually wanted this redirect.

How can i rectify it an make it work okay?

Im really hoping someone can be a bit smarter than me ๐Ÿ˜‰

Related posts

Leave a Reply

2 comments

    • Log in to your WordPress Dashboard
    • Go to Settings รขย†ย’ Permalinks
    • Select the Default settings
    • Click Save Changes button
    • Change the settings back to the previous configuration (the once you selected before
      Default). Put the custom structure back if you had one.
    • Click Save Settings

    If your site is on the main domain, e.g. http://www.yoursite.com, add this code to your .htaccess file:

    # 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
    
  1. Here’s how to have everything as blog.myhomepage.com:

    dashboard, settings, general, there’s a site URL.

    Change that to your blog.myhomepage.com.

    you can then add a redirect, 301 to your /.htaccess file of http://www.myhomepage.com
    for http://www.myhomepage.com/blog to 301 redirect to blog.myhomepage.com.

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^myhomepage.com/blog/ [nc]
    rewriterule ^(.*)$ http://blog.myhomepage.com/$1 [r=301,nc]
    

    This will bounce any content from whatever.myhomepage.com/blog/* to the blog.myhomepage.com/samecontentlink.

    in the /blog/.htaccess file:

    You just need your default wordpress .htaccess here.

    This will fix your issue, you must have the site domain url correct in dashboard, settings, general.

    If you don’t want blog.myhomepage.com but instead want everything http://www.myhomepage.com/blog/:

    If you want your subdomain to be ignored, you could simply remove it from the dns and then make sure your blog’s URL in Dashboard,settings,general is set to
    http://www.mysite.com/blog/

    and make sure the .htaccess file in /blog/ contains the base for the blog.

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