Can I use .htaccess to load my site from a different folder?
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!
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: [email protected], 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