• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

htaccess seem not being taken in account on Plesk

C

CBiLL

Guest
I was trying to fiddle around htaccess on my website which runs under Plesk 7.5.2 and I am wanting to redirect a certain ips to another website so I tried the rewrite rule and all combantion of rules with no results at all.

I was thinking that htaccess isn't working so I tried the deny from <my-ip-here> and it did not stop my ip from accessing the website at all.

I already tried restarting apache and still does not follow any new rules I put in my htaccess.

Any step I might be missing? I have adminstrator control to the Plesk .

Also could anyone give me a example of rewrite rule to use in htaccess to redirect a certain ip to another url?

Thanks
Bill
 
Also could anyone give me a example of rewrite rule to use in htaccess to redirect a certain ip to another url?
Replace the xx, yy, zz, nn with the IP address, leave the \. between each number. Change google.com to whatever URL you wish. Make sure you only have a single 'RewriteEngine on' directive. This is a 'simple' example for a single IP as requested.

# Redirect a specific IP to a different URL
RewriteEngine on
RewriteCond %{REMOTE_ADDR} xx\.yy\.zz\.nn
RewriteRule .* http://www.google.com [R]
 
Back
Top