I currently have a website (ab.example.com), where 'example.com' is the company's root domain. and 'ab' is a product's subdomain(website). Within the website (ab.example.com), I have multiple sub-products (gala, granny smith, fuji).
When a customer goes to ab.example.com/apples/gala I want them to be redirected as gala.example.com/apples. Similarly for any other sub-products I have. I understand that this is similar to .htaccess redirect to subdomain based on query string parameter, where .htaccess at the root folder is being used to add the redirect rules.
But does this mean that no changes have to be made in the cpanel or update dns entries for the new subdomains? I have also looked into the wildcard domain methood - Create subdomains on the fly with .htaccess (PHP).
I am confused about which method to use. I'm fairly new to php and its frameworks. The web application is in ,
- php
- Laravel
- Azure
- Apache
- Linux(Ubuntu)