Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcode the target protocol and hostname for the initial redirect (fixes #184) #185

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joerghoh
Copy link

No description provided.

@godanny86
Copy link
Contributor

@joerghoh is there a more generic way to make this happen? Many customers, consultants deploy WKND to non production environments for testing, demo, POC and other types of work. This change would force all of those environments to redirect the live site...

@joerghoh
Copy link
Author

Technically mod_rewrite is not longer required to write the location header with the protocol and hostname. While this is specified since a while (RFC 7231) I haven't found it documented for mod_rewrite on Apache side, so it still uses the "old behavior": It deduces the protocl and hostname part from the other information in the http header.

@joerghoh
Copy link
Author

According to this SO article it should be possible using mod_header, but I haven't got it working yet with my local setup yet:

Header always edit Location "(^http[s]?://)([a-zA-Z0-9\.\-]+)(:\d+)?/" "/"

@davidjgonzalez
Copy link
Contributor

@joerghoh could we use dispatcher variables for this? I suppose the default would have to work for local dev (empty value) and when its deployed to an AEM CS service, the user would have to make sure to set the value to the appropriate scheme/host. Couldn't find the docs on this quick enough, so figured a quick note back might be faster :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants