htaccess modify headers IF url ends with “news”

I suspect REQUEST_URI is actually resolving to something like index.php?page=xxx Yes, it would seem that mod_rewrite is processed before the Apache Expression is evaluated. So, the URL has already been rewritten to index.php (the WordPress front-controller) before we get to evaluate the requested URL in the expression. However, we can get around this by setting … Read more

redirect the homepage using .htaccess outside of WordPress

As @JacobPeattie suggested in comments: If you just add index.html to the root of your WordPress installation that should become the homepage. This does, however, require that the DirectoryIndex is set appropriately. For example: DirectoryIndex index.html The DirectoryIndex is the document that Apache tries to serve when you request a directory. In this case, the … Read more

.htaccess edits

Just switch the theme, then delete the theme you bought and after edited the .htaccess reinstall it. This should work without problems. If you have access to cpanel, set the values from the php settings section instead of rely on the .htaccess file.

Redirect http to https does not work on subdir where another instance of WordPress installed

I think the directive in .htaccess is inherited by subfolder The mod_rewrite directives in the root .htaccess file are not inherited by the /blog/.htaccess file (by default). You would need to specifically enable mod_rewrite inheritance, however, this probably adds unnecessary complexity. I try to modify the .htaccess under /blogs/ by adding the above directive again. … Read more

WordPress: Adding Security

Yes, basically debug.log, but without deny, with 404 Yes, that directive will serve a “404 Not Found” when attempting to request debug.log. |log? However, because of the ? in the above regex, it will also block debug.lo. Is that intentional? In fact, if that is intentional then you could simply remove the g? part – … Read more

Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution

The nginx equivalent of RewriteCond %{REQUEST_URI} ^.*wp-content/uploads/restricted/.* RewriteRule ^wp-content/uploads/(restricted/.*)$ dl.php?file=$1 [QSA,L] will be the location ~ ^/wp-content/uploads/(?<file>restricted/.*) { rewrite ^ /dl.php?file=$file last; } If you want to apply this to several folders under /wp-content/uploads, use location ~ ^/wp-content/uploads/(?<file>(?:restricted1|restricted2|restricted3)/.*) { rewrite ^ /dl.php?file=$file last; } I don’t think there can be any other solution for nginx … Read more

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