Can I use .htaccess to load my site from a different folder?

Category: Website

Hyponeur
Asked:
2013-09-12 4:11 am EST

Hits: 750
Hello! Probably I do write my .htaccess wrong, because I don't get the wanted result.

This is what I have:

## REWRITE URLS
RewriteEngine On
Options +FollowSymLinks

# 1st problem
RewriteRule ^/?$ site/ [NC,L]

So what is my purpose here?
I have in my public_html folder a folder called 'site'.

For now I access the test-site going here: http://vps9213.inmotionhosting.com/~hardco13/site/

I want to access the above url by going simply to http://vps9213.inmotionhosting.com/~hardco13/

# 2nd problem
RewriteRule ^register/?$ site/register.php [NC,L]

What about this simple RewriteRule? This doesn't work too, and not just this one, all of my RewriteRules doesn't work.

THE QUESTION
How to fix this and what am I doing wrong?

Thank you!

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

You must login before you can submit an answer.

I get the Error 404 - Not Found
Hyponeur
5 Points
2013-09-12 04:19 am EST
I managed this, the problem were that you don't have full .htaccess support on website testing.
Hyponeur
5 Points
2013-09-12 05:23 am EST

OTHER ANSWERS

0

johnpaulb-imhs1
Staff
10,228 Points
2013-09-12 9:15 am EST
Hyponeur,

Thank you for your question. To load your website from a specific folder, or redirect a domain without changing the URL, I recommend this tutorial which includes several examples.

First, I tested the .htaccess file successfully. Then, I reviewed your .htaccess rules and there are a lot of redirects within it, which can lead to problems, or possibly throw errors.

The easiest way to accomplish this would be to request a document root change, then do a host file modification so you can view the domain on the Server's IP.

To request a document root change, submit a written request to Live Tech Support at: support@inmotionhosting.com, be sure to include either your current Amp password, or the last 4 digits of the current credit card that we have on file for verification.

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

-John-Paul

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!