0

I added this code to my .htaccess file to get rid of index.php, but now all the pages 404 (the hyperlinks are mapped to the correct url)

# 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

i set up my permalinks using http://1.1.1.1/%postname%/

what are the next steps in order to troubleshoot this issue?

what is the default permalink for me to revert it back to when it had index.php in the url?

  • Have you confirmed that .htaccess and mod_rewrite are enabled on your server? – MrWhite Apr 17 at 22:51
0

If you want to remove the index.php from your URL structure, then using this rewrite rule (assuming you're using Apache, from your question) in your .htaccess will help.

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Then, flush permalinks by either using WP-CLI and running wp rewrite flush, or visiting the Permalinks settings page and clicking the save button. You don't need to make any changes before saving, but if you want to be sure to use just the post slug, click that radio option first, then save to flush permalinks.

  • Although the OP would seem to have already done this? – MrWhite Apr 17 at 22:52
  • @MrWhite that is correct... – jblaupunkt Apr 19 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.