Htaccess question

newsbella

Newbie
Joined
Apr 14, 2015
Messages
21
Reaction score
2
Hi,
I would like the traffic on site1.com to be redirected to site2.com only from 1pm to 2pm and from 11pm to 5am. This redirect only if users are from Italy. It's possible ?
 
I don't know if there are any plugins for this but it is possible. If you don't find any solution contact any custom plugin maker
 
Htaccess cannot do any geo redirection unless you use some apache module capable of doing so. You probably need a custom wordpress plugin coded.
 
Your best bet for doing this, is using the free geoip database (download) from Maxmind dot com and doing a php script that first checks the time range, then if within that range, include the geoip database and check the user's country code. If the code is Italy, then do a php header redirect.

Ideally, after setting that php script up, then include it in your site's head code before any output.
 
Do this with PHP and a header redirect.

.htaccess does not allow logic like this.
 
Yep, should be relatively easy in PHP. Hire someone on freelancer websites if you need help, that shouldn't cost you much.
 
Back
Top