1

mydomain.com currently points to public_html/. I want to use .htaccess to direct it to public_html/live/mysite.com/ . How can I do this?

I believe I need to add a directory to one of these lines (line 102-105 of .htaccess):

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
2

You probably wouldn't use .htaccess for this. If your webserver is Apache, your apache virtual host configuration is what points your domain to a directory on the server. On an ubuntu linux server your virtual host file would normally be in /etc/apache2/sites-enabled/mysite.com

If you are using a shared webhosting service (like Dreamhost) that uses an account configuration tool like Cpanel you can usually change your web directory using that tool. Look under options for "Domain Names" or DNS.

Don't mess with .htaccess unless you really need to--you can mess up your site or render it insecure. If you do edit .htaccess, make a backup of the original file.

1
  • On my shared house (HostGator), I don't have that cpanel option and don't have that directory available. As for modifying htaccess, you can always grab another copy from a fresh version of druapl.
    – mtro
    Dec 22 '11 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.