These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Rewrite Rules on the new forum.
This website is deprecated, and remains online only for historic access to old issues and docs for historic versions of Virtualmin. It has been unmaintained for several years, and should not be relied on for up-to-date information. Please visit www.virtualmin.com instead.
How can I add some Apache rewrite rules to be incorporated into new websites' configuration without having to manually add those rules each time I create a domain?
One way to do that would be to add your desired rules to the "Directives and settings for new websites" box in System Settings -> Server templates -> Default -> Apache website. That would then be available to all new Virtual Servers.
I guess my only thought, as I have looked at this before, is whether that would conflict with any of the rewrite rules that are added for the admin.domain.tld and webmail.domain.tld address that go to Webmin and Usermin.
Would that be an issue or would Virtualmin just append whatever it needs to underneath any rules I were to set in the server template?
Well, Virtualmin would continue to add the same rules it is today to each domain that's setup.
So long as what you are adding isn't related to admin.domain.tld or webmail.domain.tld, they shouldn't conflict -- it would be no problem to have multiple redirect rules in your config.
And, if they ever did conflict, you can always tell Virtualmin to stop adding it's own rewrite rules (the option to do that is at the bottom of the Apache Website screen).
Howdy,
One way to do that would be to add your desired rules to the "Directives and settings for new websites" box in System Settings -> Server templates -> Default -> Apache website. That would then be available to all new Virtual Servers.
Would that do what you're after?
-Eric
I guess my only thought, as I have looked at this before, is whether that would conflict with any of the rewrite rules that are added for the admin.domain.tld and webmail.domain.tld address that go to Webmin and Usermin.
Would that be an issue or would Virtualmin just append whatever it needs to underneath any rules I were to set in the server template?
Chris
Well, Virtualmin would continue to add the same rules it is today to each domain that's setup.
So long as what you are adding isn't related to admin.domain.tld or webmail.domain.tld, they shouldn't conflict -- it would be no problem to have multiple redirect rules in your config.
And, if they ever did conflict, you can always tell Virtualmin to stop adding it's own rewrite rules (the option to do that is at the bottom of the Apache Website screen).
-Eric