InMotion Hosting Support Center

Setting up re-direct with C-Panel causes sub-pages not to load


InMotionFans
n/a Points
Asked:
2015-05-21 4:48 pm EST

Hits: 126
Have a Drupal site. Site was created in a sub-directory of public_html. This worked fine, except that the sub-directory was required for all sub-pages (domain mapped to the sub-directory, so the main page would show using just the domain name,, but when you gave someone a link to some other page on the site it needed to have the sub-directory in the link). So, because people have used the site and have cached links containing the sub-directory, I added a permanent re-direct using C-Panel Redirects - redirected the domain with the subdirectory extension to the domain itself, and allowed wildcards. Initially got an error that resulted in me having to delete the .htaccess file (fortunately I just renamed it). After doing this the re-direct was established without complaint, but I subsequently discovered that none of the links on the main page worked anymore (links to other pages on the site). Moreover, it was no longer possible to pull up ANY page other than the main page, either using the old address (including the sub-directory name), or with the new address (without the sub-directory name).

Eliminating the redirect and restoring the original .htaccess file returned me to my previous state where everything worked again, but I still would like to set up the redirect to handle all the cached links out there. Any ideas how to do this successfully? I suspect I need to just edit the .htaccess file, but haven't a clue how to do that.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

John-Paul
Staff
29,164 Points
2015-05-21 5:07 pm EST
Hello,

Thank you for contacting us about redirect issues with your Drupal site. Since Drupal and (addon modules) use the .htaccess file, making changes manually (such as in cPanel) can cause issues, or interfere with existing rules.

I recommend using a Drupal module or plugin to handle redirects, such as the ones listed here. Be sure to use a module that is compatible with your version of Drupal, and it may require some testing.

If you want to manually code the .htaccess, we have a full guide on Setting up a permanent 301 redirect via .htaccess.

If you have any further questions, feel free to post them below.

Thank you,
John-Paul B

You must login before you can post a comment about this answer.

Like this Question?

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!