The default code will look something similar to this:
# 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 |
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /index.php/$1 [PT,L] </IfModule> # END WordPress |
Some clients have reported using this code variant with success:
RewriteRule ^(.*)$ /index.php/$1 [L]
Also make sure to make the .htaccess file permissions to “read-only”. This is done to prevent WordPress from modifying the .htaccess file whenever permalinks are invoked. This can be accomplished by modifying the .htaccess file permission to “004”.
To make this change go to "File Manager" in cPanel, on the top bar "Settings" button you need to enable "Show Hidden Files". Then go to "public_html" folder and right click on the file .htaccess, there go to "Change Permissions".

Please Note: After making the necessary changes in your .htaccess file, make sure to clear your browser cache by pressing "Ctrl + F5" on your keyboard and refresh your web page to see the result. In some cases you need to clear your entire browser cache by pressing "Ctrl + Shift + Del".
Modifying this line in your .htaccess file will fix errors on rewritten URLs in WordPress. As you can see, all these are coding related issues and not server related problems. So if you use another application other than WordPress, please try to modify your online application's RewriteRule along these lines inside the .htaccess file. For any assistance beyond this sample rewrite rule, you will need to hire a PHP programmer. PanelSecure's Support Team will not help you in coding related matters!