I am creating a website that has a structure with several elements, what I am trying to do is assign a custom URL that points to my application for each customer.
So, when a user buys a license from me, I will create my own URL on my web server as follows:
http:
where foo
is the name of the user who purchased the license, and scheduler
is part of the default URL, another example with a large number of customers:
http://webserver/foo.scheduler.com/login http://webserver/foo2.scheduler.com/login http://webserver/foo3.scheduler.com/login
basically there are three buyers (my customers), each user endpoint allows me to identify the correct database credentials, because in my logic each tenant has a certain db, for more data organization.
In fact, my application is located at this endpoint:
http:
I want to know if it is possible to point all user urls to http://webserver/scheduler
without rewriting the url in the browser, so for example when the user goes to http://webserver/foo.scheduler.com/login
true, this is http://webserver/scheduler/login
, but the user still continues to see http://webserver/foo.scheduler.com/login
.
How can I do that? In my .htaccess
, available inside the root of the application folder, I have this content:
RewriteEngine On RewriteBase /webscheduler/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
this allows me to rewrite the base path to the index and shunt the trace to a specific controller.