Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
24.1 Legacy Series
»
multi domain URL rewrite nginx help
« previous
next »
Print
Pages: [
1
]
Author
Topic: multi domain URL rewrite nginx help (Read 544 times)
cloudsense
Newbie
Posts: 10
Karma: 0
multi domain URL rewrite nginx help
«
on:
April 11, 2024, 03:57:24 pm »
Hi,
I have location / and one website with multi domain SSL.
the SSL are for domain.nl domain.fr domain.de domain.eu etc
what I want to do is something like this.
if url is http( or https) :// domain.(nl| fr|de| eu), redirect it to
https://www.domain.com/
$1/$2 , where $1 = nl fr de eu etc and $2 is reset of the query string ..
so if url comes to
http://domain.nl/abc/123
, it will redirect to
https://www.domain.com/nl/abc/123
This is the regex I am using
Code:
[Select]
^(?:(?:http:\/\/|https:\/\/)?(?:www\.)?)?domain\.(nl|fr|de|eu)(\/.*)?$
and the redirect is
https://www.domain.com/
$1/$2
However, this does not work .. I have tried the regex in both location block as well as http server block .
Can someone please help ?
Thanks
Logged
cloudsense
Newbie
Posts: 10
Karma: 0
[SOLVED] Re: multi domain URL rewrite nginx help
«
Reply #1 on:
April 24, 2024, 06:29:27 pm »
figured it out
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1554
Karma: 172
Re: multi domain URL rewrite nginx help
«
Reply #2 on:
April 24, 2024, 06:45:07 pm »
Logged
Hardware:
DEC740
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
24.1 Legacy Series
»
multi domain URL rewrite nginx help