I have the following RewriteCond in htaccess:
#RewriteCond %{HTTP_HOST} ^xyzdomain.com$
Now I would like to use a placeholder for the string "domain" in xyzdomain.com so that the condition matches with any domain like xyzhome.com, xyztravel.com, xyzshop.com, xyz*.com, etc.
Which placeholder can I use for the string?
It's just a regex. You can do something like:
RewriteCond %{HTTP_HOST} ^xyz(.+)\.com$
The (.+)
will match "any character one or more times".
Also note the \
escaping the .
in .com
. .
is a special wildcard character with regular expressions so you have to escape it when you want to explicitly match .
.
regular-expressions.info is a great place to learn more about how they work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With