I added this code to my .htaccess file to get rid of index.php from the website urls, 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 /%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?
I added this code to my .htaccess file to get rid of index.php from the website urls, 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?
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.
.htaccess
and mod_rewrite are enabled on your server? – MrWhite Commented Apr 17, 2019 at 22:51