Author Topic: ip to name how to do?  (Read 2950 times)

0 Members and 1 Guest are viewing this topic.

ip to name how to do?
« on: September 06, 2021, 11:22:12 AM »
We have a CWP and all working fine. Now the base IP is (for example) and we want this IP not to serve any pages as we cannot set any SSL on IP. So is it possible to have the .htaccess in /usr/local/apache/htdocs have some redirect option? If we put a htaccess in there the redirection does not work at all. We added the correct user to the .htaccess and put this inside there:
(ip is fictive)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^12\.34\.56\.789$
RewriteRule ^(.*)$$1 [L,R=301]

Redirect is configured just fine but not running. Hope you guys can maybe have some help?

I also get this in the logs:
 client denied by server configuration: /usr/local/apache/htdocs/.htaccess
Nothing is changed on apache side it is default.
« Last Edit: September 06, 2021, 11:45:08 AM by fysioski »

Re: ip to name how to do?
« Reply #1 on: September 07, 2021, 05:57:39 AM »
this also depends on the running webserver, htaccess is for apache only. so if you have apache and nginx, the htaccess is the wrong place doing this.

If you have apache only this should do the trick:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^11\.11\.11\.111$ [NC,OR]
RewriteCond %{HTTP_HOST} ^([a-z.]+)?mydomain\.com$ [NC]

Re: ip to name how to do?
« Reply #2 on: September 16, 2021, 09:38:29 PM »
You can simply add to .htaccess
Redirect 301 /
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
Join our Development Team and get paid !

Installation Instructions
Get Fast Support Here