Forum Moderators: phranque

Message Too Old, No Replies

Accessing another directory

         

ebloggy

3:31 am on Sep 9, 2003 (gmt 0)

10+ Year Member



My directory tree is something like (these are all folders):

¦ - domain.com
¦ ¦ - images
¦ - subdomain.domain.com

I have a .htaccess file in subdomain.domain.com
How do I do a redirect to a file in domain.com?
I do not wish to do an external redirect i.e. using the [R] flag

Is this possible?

Thanks in advance?

jdMorgan

4:04 am on Sep 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ebloggy,

You don't have to do an external redirect. You just have to think in terms of URLs being different things from server pathnames. They do not have to have any relationship at all. As long as your subdomain and main domain are under the same filesystem, just detect the URL that you need to "redirect", and serve a file stored somewhere else in the file system.

The above is general since you described your URL structure and not your directory structure, but if the subdomain shares filespace with the main domain, it should be easy to do what you want.

Jim

ebloggy

2:08 pm on Sep 10, 2003 (gmt 0)

10+ Year Member



In that case, how would I redirect to folder public_html when my .htaccess is in folder subdomain, and subdomain and public_html are side by side (e.g. /home/user/public_html and /home/user/subdomain)

Thanks