2019-10-13, 11:47 AM
2019-10-13, 12:12 PM
Best way would be to use something like this https://www.siteground.com/kb/how_to_red...ther_site/
2019-10-13, 01:51 PM
I think a plugin hooks
global_start
should be able to do that job.2019-10-14, 05:23 AM
(2019-10-13, 12:12 PM)Ben Wrote: [ -> ]Best way would be to use something like this https://www.siteground.com/kb/how_to_red...ther_site/
I am using nginx so I may need another option (there is no .htaccess in my server)
(2019-10-13, 01:51 PM)noyle Wrote: [ -> ]I think a plugin hooks global_start
should be able to do that job.
Not entirely sure how to start doing that honestly
2019-10-14, 09:26 AM
You need to edit the nginx configuration either for "server" or a specific "location" stanza, like this
Find a lot of examples in the net by searching for nginx rewrite.
[ExiTuS]
server {
if (%{$remote_addr !~ "^1.2.3.4"){
rewrite /.* http://www.example.com redirect;
}
orlocation / {
if (%{$remote_addr !~ "^1.2.3.4"){
rewrite /.* http://www.example.com redirect;
}
or... { rewrite ^/$ http://www.example.com redirect; }
Find a lot of examples in the net by searching for nginx rewrite.
[ExiTuS]
2019-10-14, 11:16 AM
(2019-10-14, 09:26 AM)[ExiTuS] Wrote: [ -> ]You need to edit the nginx configuration either for "server" or a specific "location" stanza, like this
orserver { if (%{$remote_addr !~ "^1.2.3.4"){ rewrite /.* http://www.example.com redirect; }
orlocation / { if (%{$remote_addr !~ "^1.2.3.4"){ rewrite /.* http://www.example.com redirect; }
... { rewrite ^/$ http://www.example.com redirect; }
Find a lot of examples in the net by searching for nginx rewrite.
[ExiTuS]
Unfortunately neither of those work properly for me, and I receive an error after replacing the IP and domain. Is there further modification required other than that?
2019-10-14, 11:27 AM
Stupid question, why don't use https://community.mybb.com/mods.php?action=view&pid=474 ? With good settings, it could work for your needs.
2019-10-14, 11:42 AM
(2019-10-14, 11:27 AM)Crazycat Wrote: [ -> ]Stupid question, why don't use https://community.mybb.com/mods.php?action=view&pid=474 ? With good settings, it could work for your needs.
Hmm I don't think that'd be the best way to do it, and honestly I think there is an easier way to do it like Exitus and Ben showed but maybe a problem with the code or something which is why I cant get it to work with my website
2019-10-14, 12:10 PM
For performance purpose, it is the best way to do a redirect on a lower level, so webserver.
Sorry, if my example config code does not work well - because of a syntax slip. I am not well familiar with this webserver. So do not copy/paste the code but take it as an inspiration on how to do such on nginx.
[ExiTuS]
Sorry, if my example config code does not work well - because of a syntax slip. I am not well familiar with this webserver. So do not copy/paste the code but take it as an inspiration on how to do such on nginx.
[ExiTuS]