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 http://preview.mydomain.com/someuser Preview Website on the new forum.
Hi All,
Right I have read the following FAQ, and understand what its saying, but I don't ideally want to create a subdomain every time a new server is created. http://virtualmin.com/documentation/web/faq
Is there any way to create one subdomain for example preview.mydomain.com to be able to preview any directory under the home dir?
I ask as I have some users that want to preview their websites before DNS changes goes live, just to test everything is working before they switch records, but I dont want to give them access to their virtualmin accounts at the moment.
With the security issues with the /~username and that I couldnt get PHP to work using this, I was hoping I could do it the way I mentioned above, but not sure how to go about it.
Howdy,
I'd definitely recommend the "Alias" method that you read about.
It's not actually something you'd need to add manually for new domains -- using System Settings -> Server Templates -> Default -> Virtual Server Creation -> Automatically create alias domain, it'll actually create an Alias for you automatically, anytime a Virtual Server is created.
That just adds a single "ServerAlias" entry into Apache, it's not generating any overhead to use that option.
For existing domains, you would need to manually add that though, by creating a new Virtual Server alias.
Those are the primary Virtualmin-supported ways of handling that though, either using the Preview Website in Virtualmin, or by creating the aliases.
-Eric