Redirect domains to another page via .htaccess
Hello,
I have a client who owns several domains that should point to a single domain he also owns. The client has not built websites for them, so they are not hosted anywhere.
Following this article on redirecting domains via .htaccess, the script below is what I used to attempt to forward a request to two of the client's domains to my business domain as a test:
RewriteCond %{HTTP_HOST} ^yourdailyscholarship\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.yourdailyscholarship\.com$
RewriteRule ^(.*)$ "https\:\/\/www\.tektonpro\.dev\$1" [R=301,L]
The script was unsuccessful, so no redirection occurred.
My questions are: (a) am I on the right path in thinking that using .htaccess is the best path forward to redirect requests made to unhosted domains (I'm basing that off of this stack exchange), and
(b) if so, what is wrong with the script above?
Thank you!
TP Admin
-
Hey there! No, I wouldn't use .htaccess for this type of work. You're going to need *something* in the Apache configuration in order for the domain to get processed on your server.
You can use the cPanel >> Domains interface to create an Alias. Just use the "Create a new domain" button there and ensure the "Share document root" button is selected. That creates and alias that points to the same location as an existing site.
0 -
Hi, cPRrex
Thanks so much for replying. I attempted your recommended approach but encountered an "unknown error" regardless of the domain I attempted to create. Again, the domains I enter into these fields do not have hosting services attached to them.
Please see the screenshot below.
The documentation for creating a new domain states, "To create a new domain, your hosting provider must enable at least one the following features...":
- Addon Domains
- Aliases
- Subdomains
I am unsure whether the host (Bluehost) enabled any of these. Is this a likely explanation for the error message? Is there a way to find more details about the error message to report to support?
Thank you for your help,
TP Admin
0 -
It's completely possible that you've reached some internal limit that Bluehost has set for your account, but you'll have to reach out to them either way as your cPanel account won't have enough permission to access the logs or files necessary to resolve that issue.
0 -
Hi, cPRex
Understood. Thank you very much for your assistance.
TP Admin
0 -
Sure thing - I'm sorry I can't do more on my end!
0
Please sign in to leave a comment.
Comments
5 comments