-
Notifications
You must be signed in to change notification settings - Fork 3
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
Request: Enforce main domain for environment #17
Comments
I've considered that and I think it does fall within the scope of what could be handled via Patrol. You mentioned a performance hit and I think that if you can handle it at the server level or even |
@sjelfull What UI/options do you think this feature should include? Should it just allow you to select |
I guess this is as much out of convenience as out of care for the performance. I think you should be able to define what your main domain is, if that's what you you mean by The use case I have in mind at the moment is a site where we used a temp. subdomain provided by the host while we were preparing to launch. After launch, the site is still available from the subdomain, and some of the staff of the client is still using domain. That leads to some instances where it leaks into search results and cache. I would like a easy way to enforce it, so that it doesn't matter if not all do as instructed. |
@sjelfull So, let me see if I understand this right. Please correct me if I'm wrong. You might have a local domain like Your production will be I've decided to make this a feature, so if you can just add clarification on your use case, that will be really helpful. |
Thanks, that's exactly what i'm after. |
@sjelfull Here is what I'm thinking... To add a new setting called If That would mean that if you have a multi-environment config set up, you could: return [
// all
'*' => [
'patrol' => [
'primaryDomain' => 'domain.com'
],
],
// local
'.dev' => [
'patrol' => [
'primaryDomain' => '' // or local.dev
],
],
]; This would work independently from SSL of course. Thoughts? |
@sjelfull I've gone ahead and implemented this feature. Would you be able to test things out and provide some feedback? I'd like to clean up or fix any small bugs (if any) before cutting an official release. All you have to do is updated your config file with something like this: return [
// all
'*' => [
'patrol' => [
'primaryDomain' => 'domain.com'
],
],
// local
'.dev' => [
'patrol' => [
'primaryDomain' => '*'
],
],
]; |
Looks great. I'm on holidays currently, so probably won't be able to test it out before the 25th. |
@sjelfull Ok, release https://github.com/selvinortiz/craft.patrol/releases/tag/v1.4.1 should do what you want:) |
I would love a way to enforce a main domain for an environment where you have multiple domains connected, eg. domain.com and www.domain.com.
Before, I handled this in .htaccess, but I feel that this requires a unnecessary performance hit, however small.
Do you think this would be something that fits within the realm of Patrol?
I'm currently using Hearty to handle environments.
The text was updated successfully, but these errors were encountered: