Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

First, sorry for the shocking level of no-coding-skills. So what is probably best is that I describe what I want first.

I have 2 domain names, linking to one hosting package (yes, cheap-ass option, but anyway).

One of them - the original domain, which the code below is for - is based off of the root directory of my web hosting, the other is based in a folder called /getfilm/

The following was my .htaccess file before I got this new domain and set it up.

ErrorDocument 404 /404.html

RewriteEngine On
RewriteCond %{HTTP_HOST} !^rowancavanagh.com$ [NC]
RewriteRule ^(.*)$ http://rowancavanagh.com/$1 [L,R=301]
<ifmodule mod_rewrite.c>
RewriteCond %{REQUEST_URI} !^/favicon\.ico [NC]
RewriteCond %{REQUEST_URI} favicon\.ico    [NC]
RewriteRule (.*) http://rowancavanagh.com/favicon.ico [R=301,L]
</ifmodule>

Now obviously this forces my new domain 'getfilm.co.uk', to change to 'rowancavanagh.com'. Which I obviously don't want.

I have no idea where to start, but can I possibly duplicate all of these actions to work with both 'rowancavanagh.com' at the root directory and 'getfilm.co.uk' above the root in /getfilm/ ?

share|improve this question
add comment

migrated from stackoverflow.com May 7 '11 at 10:45

This question came from our site for professional and enthusiast programmers.

1 Answer

If Apache is setup to have /getfilm (on your filesystem) be the DocumentRoot for the domain getfilm.co.uk, then yes, you can simply create another .htaccess file and place it in this directory.

Note however, the Apache documentation recommends against using .htaccess files if you have access to the main server configuration file (you may not). In this case you could simply places your directives under the appropriate section.

See http://httpd.apache.org/docs/current/howto/htaccess.html for more details and why Apache recommends against .htaccess if possible.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.