I have run into a problem with my WordPress blog. Previously, I could access pages using URLs like https://mywebsite.com/index.php/all. However, something unexplainable happened such that this URL has been renamed to https://mywebsite.com/?page_id=102. I have tried to change the permalink structure under settings and the link breaks. When the link appears as https://mywebsite.com/all it does not load in the browser. When I manually write it in the browser URL bar as https://mywebsite.com/index.php/all it automatically redirects to https://mywebsite.com/all. It seems as though I can no longer use the index.php name that was previously contained in the original URL pattern hence cannot access the links using human friendly names. How can I possibly fix the problem?
Advertisement
Answer
Looks like your .htaccess file was overwritten. Simplest solution is to change the permalink setting back to page_id and then again to Post name it should overwrite .htaccess file, if not try to put that into your .htaccess:
# BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress