Hot answers tagged

4

You just need to implement your more specific redirect first, before your "generic" redirect everything else directive. For example: RewriteCond %{HTTP_HOST} example\.net$ [NC] RewriteRule ^en$ https://example.com/abc [L,R=301] RewriteCond %{HTTP_HOST} example\.net$ [NC] RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301] Aside... RewriteCond %{...


3

Try something like the following at the top of your .htaccess file to redirect the URL: RewriteEngine On RewriteRule ^feeds/\d+/comments/default /feeds/ [R=301,L] The pattern \d+ matches 1 or more digits. If the /comments/default part is not critical to make a match then it can be removed. If just matching a single digit is sufficient then change the regex ...


2

There is indeed another setting that controls redirects. To make Apache look at .htaccess, it is necessary to change the AllowOverrides line in the apache .conf file for the site: <Directory /var/www/oldsite/> Options FollowSymLinks AllowOverride **None** Require all granted </Directory> You can replace None by All to enable ...


2

Try the following at the top of your .htaccess file: RewriteRule (.*)-2/$ /$1/ [R=301,L] Any URL that ends in -2/ is redirected to the same URL without -2. The $1 (in the substitution string) is a backreference to the captured group (the part before the -2/) in the RewriteRule pattern.


2

I can't see inside the rule/logic that might actually be causing this alert so take this for what it is worth. I'm assuming they have some type of logic that detects the struts attack attempt and then notices a DNS request for the domain in the attack string. This would be the behaviour from the victim if the attack was successful, it would try to ping that ...


Only top voted, non community-wiki answers of a minimum length are eligible