How to create a redirect in the .htaccess file, with 2 exceptions

Try the following, before the existing WordPress directives: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !^(abc|abc-def-g)$ / [R,L] This states that for any URL that is not /abc or /abc-def-g and which does not map to a physical file or directory (ie. your static resources, images, CSS, JS, etc.) then redirect to the homepage. The … Read more

subdirectory index.php is not working

All you should need to do is make sure the appropriate DirectoryIndex is set. For example, at the top of your .htaccess file: DirectoryIndex index.php This instructs mod_dir to try to serve index.php when requesting a directory, eg. /sq/first/. If you are requesting URLs/directories that don’t already contain the trailing slash, as in your example: … Read more