You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Misterer <rd...@yahoo.com> on 2008/12/24 12:08:37 UTC

[users@httpd] .htaccess mod_rewrite help

Hello,

I'm trying to create certain functionality using .htaccess files only.

Suppose we have a domain and a subdomain with document roots as follows:

domain.com -> /home/user/public_html
sub.domain.com -> /home/user/public_html/sub

The contents of /home/user/public_html are as follows ([]'s are directories):


[something]

[something_else]

[sub]

main.file

sub.file

What I'd like to do is this:
Make all domain.com requests that do not request an actual filename go to main.file file.
Make all sub.domain.com requests that do not request an actual filename go to main.file file.
I can do what I want using VirtualHosts easily (one for domain.com and another for sub.domain.com) but I'm not sure about .htaccess here. How would you do this?