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

.htaccess RewriteCond excluding directories does not work when there is an .htaccess or php.ini in subdirectory

You can try adding RewriteEngine On to the top of the subdirectory .htaccess file. This will have the effect of completely overriding the mod_rewrite directives in the parent (ie. WordPress) .htaccess file, because mod_rewrite directives are not inherited by default. So by enabling the rewrite engine in the subdirectory, the WordPress front-controller will not execute … Read more

where to add redirection rewriterule in .htaccess file?

Your external redirect needs to go at the very top of your .htaccess file, before the WordPress front-controller (ie. before the # BEGIN WordPress section). If you place it at the end of the file then it will simply never get processed, because the WordPress front-controller routes all URLs and then stops further processing. If … Read more

.htacess rewrite condition: page to seconddomain/page

RewriteCond %{HTTP_HOST} ^seconddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.seconddomain.com$ RewriteRule ^(.*)$ index.php?page_id=78 [NC,QSA] The “problem” with this is that it rewrites seconddomain.com/<everything> to /index.php?page_id=78. If you only want the second domain’s home page to be served with page_id=78 then you should change the RewriteRule pattern to match just the home page (ie. an empty URL-path). For example: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)