.htaccess rewrite rule doesn't work on OLS with cyberpanel

#1
I am trying to get this rewrite rule working on OpenLiteSpeed Server with Cyberpanel.

Code:
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_REFERER} abc.com [NC]
RewriteRule ^/?download/(.*) https://abc.com/ [R=301,L,NC]
</IfModule>
Please help.
 

Pong

Administrator
#2
Please try the following rule:
Code:
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_REFERER} abc.com [NC]
RewriteRule ^download https://abc.com/ [R=301,L,NC]
</IfModule>
Make sure you restart OLS everytime you made change to .htaccess

If this virtual host is for abc.com domain only, you may NOT need the following condition, just one line rewrite rule should be fine.
Code:
RewriteCond %{HTTP_REFERER} abc.com [NC]
 
Top