Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regex Question

Status
Not open for further replies.

johngiggs

Technical User
Oct 30, 2002
492
US
Hi,

I am doing some regex to allow CORS for specific domains. Currently I'm using the following:

SetEnvIf Origin "^http(s)?://(.+\.)?(mysite\.org|mysite2\.com)$" CORS_ALLOW_ORIGIN=$0

This should allow *.mysite.org and *.mysite2.com via CORS. The problem I'm encountering is that if the DNS record contains a dash (i.e. uat- it does not work. What is the proper regex to support that?

I'm fine with a wildcard for all records for that domain.

Any help would be greatly appreciated.

Thanks,

John
 
Hi,

I tried the following, but I don't think it's fully working as expected.

SetEnvIf Origin "^http(s)?://(.+\-)?(.+\.)?(mysite\.org|mysite2\.com)$" CORS_ALLOW_ORIGIN=$0

Any thoughts on what's needed to support URLs like this:

uat-dev-uat-dev-
Thanks,

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top