WordPress Permalink 404 Error after Subdomain to Root Migration

10,315

Solution 1

I got the permalinks to work for Godaddy. I had to add an extra line in .htaccess to make this work. GoDaddy appears to be taking 404 error page over .htaccess and thus was giving errors for all pretty permalink request.

ErrorDocument 404 /index.php

# 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

The ErrorDocument 404 /index.php line above makes all the difference with GoDaddy. It forces handling of 404 error with that of WordPress index page and works fine.

Hope this helps everyone trying to make pretty permalinks like %postname% work with Godaddy

Solution 2

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

# END WordPress
Share:
10,315
Vaibhav K
Author by

Vaibhav K

Front-end Developer &amp; Designer.

Updated on June 04, 2022

Comments

  • Vaibhav K
    Vaibhav K almost 2 years

    I have a WordPress installation at Subdomain. I wish to have the website display the blog at http://www.website.com

    The WordPress folder is located at http://www.website.com/wordpress/

    The migration is complete but the pretty permalinks do not work. For the default permalink structure, its fine but for /%postname%/ it displays 404 Errors.

    This is the .htaccess code WP has generated in the root

    # 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