I have an application with URLs such as these:
https://www.domain.com/example/public/subscription
https://www.domain.com/example/public/subscription/source
https://www.domain.com/example/public/test/subscription
I’d like to use mod_rewrite (or some other method) to create shorter “aliases” of the above URLs by removing the /public/ part so that I can provide my client with these shorter versions of the URLs:
https://www.domain.com/example/subscription
https://www.domain.com/example/subscription/source
https://www.domain.com/example/test/subscription
In other words, when browsing to https://www.domain.com/example/subscription, for example:
- The server must send back the same response that one would get when opening
https://www.domain.com/example/public/subscriptiondirectly - The browser must still display the shorter version of the URL (without the
/public/) in the address bar
Is this even possible, and how would such a RewriteRule look like?
Thank you in advance.
put this is
.htaccessfile in yourDocumentRoot.