I am looking for a way to create a redirect that will do the following:
redirect any subdomain to the same set of files without changing the url.
We have the wildcard redirect in place but we are hosting multiple websites on our hosting package so the wildcard is sending the subdomain to the wrong website. We need to create a redirect that will direct them to the correct files.
If possible we would like to use an htaccess redirect but if there is another matter we are open to suggestion.
example
test1.website.com
test2.website.com
test3.website.com
will all use the files found in public_html/website.com/files
The goal is for our sales team to put their name as the subdomain without us having to create new subdomains for everyone. The website will log the subdomain that is being used to give credit for the sales.
---------- Post added at 01:47 PM ---------- Previous post was at 09:51 AM ----------
I have tried the following but it just shows
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{HTTP_HOST} !^www\.parentsite\.com?$
RewriteCond %{HTTP_HOST} ^([^.]+)\.correctsite\.com?$
RewriteRule ^$ /correctsite [L]
parentsite being the site that the account was created under
/correctsite being the name of the folder that the addon domain was created in.
But is just shows test.correctsite.com/directory
im looking for a way to prevent this url change
redirect any subdomain to the same set of files without changing the url.
We have the wildcard redirect in place but we are hosting multiple websites on our hosting package so the wildcard is sending the subdomain to the wrong website. We need to create a redirect that will direct them to the correct files.
If possible we would like to use an htaccess redirect but if there is another matter we are open to suggestion.
example
test1.website.com
test2.website.com
test3.website.com
will all use the files found in public_html/website.com/files
The goal is for our sales team to put their name as the subdomain without us having to create new subdomains for everyone. The website will log the subdomain that is being used to give credit for the sales.
---------- Post added at 01:47 PM ---------- Previous post was at 09:51 AM ----------
I have tried the following but it just shows
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{HTTP_HOST} !^www\.parentsite\.com?$
RewriteCond %{HTTP_HOST} ^([^.]+)\.correctsite\.com?$
RewriteRule ^$ /correctsite [L]
parentsite being the site that the account was created under
/correctsite being the name of the folder that the addon domain was created in.
But is just shows test.correctsite.com/directory
im looking for a way to prevent this url change