Forum Moderators: phranque

Message Too Old, No Replies

httpd.conf settings

i need do changes in virtual host

         

anshul

7:36 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



my hosting company told me httpd.conf is configured on server-level; i can't access it.

what i intend do is to navigate from one sub-domain folder to other sub-domain folder.

e.g. <IMG src="../images/logo.png">
instead of
<IMG src="http://mysite.com/images/logo.png">

assume all sub-domain folders and 'images' folders are in 'public_html' folder.

is this possible using some .htaccess trick?
any other way?
please help.

[edited by: jdMorgan at 3:45 pm (utc) on July 29, 2004]
[edit reason] spelling [/edit]

pete_m

10:45 am on Jul 29, 2004 (gmt 0)

10+ Year Member



By "sub-domain folders", do you mean subfolders?

If the images folder is in public_html, you should be able to use links in the format:

<img src="/images/logo.png" />

anshul

1:24 pm on Jul 29, 2004 (gmt 0)

10+ Year Member



I mean subdomain folders.

You see, sub_domain folders resolves as
mysubdomain.mydomain.com
We need that, it should resolve as
mydomain.com/mysubdomain/

This can be done by httpd.conf setting but I have no access to http.conf file. Any other trick? Maybe .htaccess code can't do it?

Anyone there to help me?

[edited by: jdMorgan at 3:47 pm (utc) on July 29, 2004]
[edit reason] spelling [/edit]

jdMorgan

4:09 pm on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anshul,

pete_m's question is a good one. We need to know how your subdomains currently resolve to the filesystem of your server. If a request for a subdomain is received, where does the server "go" to retrieve files?

The dependencies are:

  • Where do your DNS records "point" each subdomain? (The usual case is to point them all to one IP address, but this must be checked.)
  • How are those requests handled currently by the server? (Are the subdomains currently "mapped" to different directories or "user accounts" by your host, using code in httpd.conf?)

Without this information, it is impossible to determine if an .htaccess solution will work, or what it might be.

Jim

anshul

7:41 pm on Jul 30, 2004 (gmt 0)

10+ Year Member



i thank u4ur interest.

what information i know is that my all subdomain folders reside in 'public_html' or 'www' folder.
there is single ip for that.

i type mysubdomain.mydomain.com to get index page of that mysubdomain folder.
i type mydomain.com/articles to get index page of that articles folder.
both folders 'mysubdomian' and 'articles' are in same folder: my 'public_html' or 'www' folder.

i can't jump out of 'mysubdomain' folders using relative urls ( ../ scheme )
i don't h've rights2access httpd.conf file.
but i can create modify .htaccess files in any of my folders.

please assume missing information.
please provide a ( guesssed ) help.
great thanks.

jdMorgan

9:49 pm on Jul 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In order to cross "subdomains" you will have to use a full URL or ask your host to map all of your subdomains to your main folder. If they do that, you can then use .htaccess to map them to subdomain folders (do it yourself instead of having the host do it in httpd.conf), and then add an exclusion for your common image directory to allow all subdomains to access them.

Here is a discussion including the code for rewriting arbitrary subdomains to subdirectories using mod_rewrite in .htaccess [webmasterworld.com] -- See msg #6.

This has a negative performance impact -- it is faster to do mod_rewrite or mod_alias stuff in httpd.conf, but it will give you the control you need.

Jim