0
votes

WordPress page/page is not working after moved the file to subdomain. URL structure domain.com/subdomain/post1 is loading as domain.com/subdomainpost1 - slash (/) is missing before post/page slug. Home page and Other site assets working fine (i.e., images, css, js) - Only post and pages not loading.

Site .htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /subdomain/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subdomain/index.php [L]
</IfModule>
# END WordPress

I have updated different permalink and still, it's not working. Also, deactivate all plugins and tested, still no fix. Someone, please help me to fix.

1

1 Answers

0
votes

Generally you shouldn't be messing around with .htaccess files, if you don't fully understand the rewrite rules you're changing or the security risks.

Besides that, I assume that your "home" and "siteurl" are both updated in the database, so the easiest way to go from here, would probably be to delete the .htaccess file and then save permalinks in the admin page.

By doing so, WordPress will automatically generate a new .htaccess file that logically should be working out of the box. Then you can add your authorization block afterwards. That should go somewhere below the # END WordPress comment. You should never have to change the default WordPress .htaccess rules as it potentially breaks stuff.

If it still messes up, try searching your database for wrong formatted url's etc.