SOLVED How can I redirect the main homepage and other subpages seperately?

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
I want to redirect my main homepage to redirect (e.g. example.com) to a seperate website but also redirect other subpages (e.g. example.com/contact) to a seperate website as well. But when I redirect my main page it doesn't allow the other subpages to be redirected.

Example:
example.com ---> example.org
example.com/contact ---> example.org/contact
I use UkCheapHosts to host my website and configure using cPanel. How can this work?

If I put a redirect onto example.com to redirect to example.org it works fine, but when I add another redirect from example.com/contact to example.org/contact, it doesn't work........

Help is much appreciated.
 
Last edited by a moderator:

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
It sounds like what you want is a wildcard redirect. You can select the checkbox at cPanel>>Domains>>Redirects when creating the redirect.
Hi Lauren - Sorry, this hasn't worked, I have tried a wildcard on the main page as well as on the other page and when I run the address, I get "Error establishing a database connection" - there's got to be a way to do it....hasn't there?

Oliver
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
That specific error doesn't sound related to a redirect it sounds specific to the database. The redirect only controls *where* you go it does not have anything to do with the DB status.
 

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
That specific error doesn't sound related to a redirect it sounds specific to the database. The redirect only controls *where* you go it does not have anything to do with the DB status.
HI again Lauren - if you know how to solve my issue, please could you write out a couple of steps I can take to get al redirects working - I really need this fixed.....
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hello,

Again, based on the information you've provided I it sounds as though the issue is actually your connection to the database, not the redirect. If you can confirm that the site goes from originalsite.tld/contact -> newsite.tld/contact with the wildcard enabled that is functioning. As for the error on newsite.tld I have literally 0 information on this error provided by you so far so I am unsure how I would have provided you information on its resolution.
Most commonly this is an incorrect db password in the CMS's configuration script for the database. But you may want to contact your provider in the event that you are either not using a CMS or you've confirmed that the password for the one you're using is correct.
 

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
with the wildcard enabled
Which one should have the wildcard enabled? The main homepage or /contact?


Hello,

Again, based on the information you've provided I it sounds as though the issue is actually your connection to the database, not the redirect. If you can confirm that the site goes from originalsite.tld/contact -> newsite.tld/contact with the wildcard enabled that is functioning. As for the error on newsite.tld I have literally 0 information on this error provided by you so far so I am unsure how I would have provided you information on its resolution.
Most commonly this is an incorrect db password in the CMS's configuration script for the database. But you may want to contact your provider in the event that you are either not using a CMS or you've confirmed that the password for the one you're using is correct.
The Error establishing a database connection message appears when I go to www.example.com/contact. How could I go about sorting this? - What would you suggest I do?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
It's no different than what I suggested previously, as far as troubleshooting the db error.

If what you're saying is your issue is that www.example.com/contact isn't redirecting you missed the checkbox in the redirect that indicates "Redirect with or without www" and it should be added with that.
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
37
103
USA
cPanel Access Level
Root Administrator
Hello @ORICKETTS

It sounds as though the database issue is altogether separate from your initial question about URL redirects.

I understand that you are attempting to set up these redirects:

1. example.com ---> example.org
2. example.com/contact ---> example.org/contact

You've relayed that number 1 works, but number 2 does not work. What is the result when you visit example.com/contact after you've attempted to enable redirection number 2? Does your browser load example.com/contact and give no signs of redirecting?
 

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
Hello @ORICKETTS

It sounds as though the database issue is altogether separate from your initial question about URL redirects.

I understand that you are attempting to set up these redirects:

1. example.com ---> example.org
2. example.com/contact ---> example.org/contact

You've relayed that number 1 works, but number 2 does not work. What is the result when you visit example.com/contact after you've attempted to enable redirection number 2? Does your browser load example.com/contact and give no signs of redirecting?
Hi Samuel - when I visit example.com/contact, it loads and gives no sign of redirecting. Thanks
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
37
103
USA
cPanel Access Level
Root Administrator
Hello @ORICKETTS

Thank you for replying. Would it be possible for you to share a screenshot of the Redirects page from the cPanel account? This will give us a better idea of how the redirects are currently configured. Please make sure to exclude any identifying information such as your server's hostname or IP address, as well as the cPanel user name and domain name.
 

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
Hello @ORICKETTS

Thank you for replying. Would it be possible for you to share a screenshot of the Redirects page from the cPanel account? This will give us a better idea of how the redirects are currently configured. Please make sure to exclude any identifying information such as your server's hostname or IP address, as well as the cPanel user name and domain name.
Thanks @cPSamuel - I've contacted my domain provider and they sorted it :)
 

ORICKETTS

Member
Jun 3, 2020
8
0
1
UK
cPanel Access Level
Website Owner
I want to redirect my main homepage to redirect (e.g. example.com) to a seperate website but also redirect other subpages (e.g. example.com/contact) to a seperate website as well. But when I redirect my main page it doesn't allow the other subpages to be redirected.

Example:
example.com ---> example.org
example.com/contact ---> example.org/contact
I use UkCheapHosts to host my website and configure using cPanel. How can this work?

If I put a redirect onto example.com to redirect to example.org it works fine, but when I add another redirect from example.com/contact to example.org/contact, it doesn't work........

Help is much appreciated.
@ALL - Question Solved