Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Apache Help
Index -> General Discussion
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Amailer




PostPosted: Sat Oct 02, 2004 5:59 pm   Post subject: Apache Help

EDIT:
Actually, that code doesn't work at all Razz it is the code below
code:

<VirtualHost 192.168.0.6>
UseCanonicalName off
VirtualDocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/termix/SUBDOMAIN/HOSTING/%1"
ServerName *.gfx-pro.ath.cx
ServerAlias www.*.gfx-pro.ath.cx
</VirtualHost>

that works Sad anyone know now... lol



Hello,
Well I know I have posted some topics on this before, but this is a slightly new problem Rolling Eyes.

I have in a .htaccess file (in the htdocs directory) this code
code:

# Rewrite <subdomain>.example.com/<path> to example.com/<subdomain>/<path>
#
# Skip rewrite if no hostname or if subdomain is www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
# Extract (required) subdomain (%1), and first path element (%3), discard port number if present

(%2)
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.gfx-pro\.ath.cx(:80)?<>/([^/]*) [NC]
# Rewrite only when subdomain not equal to first path element (prevents mod_rewrite recursion)
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
# Rewrite to /termix/path
RewriteRule ^(.*) termix/SUBDOMAIN/HOSTING/%1/$1 [L]


It works fine! It actually works Smile
Except the problem is, if I go to.. suppose there are the folders

Microsoft, apple, linux in the directory hosting.
And i go to

http://www.Microsoft.gfx-pro.ath.cx
it doesn't work!, it searchs for www (as seen in the error below)

code:

[Sat Oct 02 18:53:01 2004] [error] [client 67.70.121.62] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/termix/SUBDOMAIN/HOSTING/www
[Sat Oct 02 18:53:01 2004] [error] [client 67.70.121.62] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/termix/SUBDOMAIN/HOSTING/www
[Sat Oct 02 18:53:01 2004] [error] [client 67.70.121.62] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/termix/SUBDOMAIN/HOSTING/www


But it works fine if i just go to

http://microsoft.gfx-pro.ath.cx

Any ideas on how to solve this? I know or at least I think it is because, since my domain is already a subdomain, it doesn't work well with a 4 level domain. (or sub-subdomain i.e level4.level3.level2.level1)

Any ideas would be great
Thanks (in advance).
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sat Oct 02, 2004 6:04 pm   Post subject: (No subject)

Last I recalled, rewrites only work on the path, not the server name.
Amailer




PostPosted: Sat Oct 02, 2004 6:09 pm   Post subject: (No subject)

Well, No clue lol got it off a site. Rolling Eyes
Anyway, but I wrote the code that i posted a minute ago (edited the post).
and thats what works, not that rewrite code.

Any clues on how to make that work with www. also?

I tried,
code:

RewriteEngine on
RewriteCond   %{HTTP_HOST}                 ^www\.[^.]+\.gfx-pro\.ath.cx$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule   ^www\.([^.]+)\.gfx-pro\.ath.cx(.*) \termix\SUBDOMAIN\HOSTING\$1$2


(got this from http://httpd.apache.org/docs-2.0/misc/rewriteguide.html)
but it doens't work, the error log shows.

code:

[Sat Oct 02 19:17:02 2004] [error] [client 67.70.121.62] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico
[Sat Oct 02 19:17:03 2004] [error] [client 67.70.121.62] Directory index forbidden by rule: C:/Program Files/Apache Group/Apache2/htdocs/
[Sat Oct 02 19:17:03 2004] [error] [client 67.70.121.62] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico
[Sat Oct 02 19:17:09 2004] [error] [client 67.70.121.62] Directory index forbidden by rule: C:/Program Files/Apache Group/Apache2/htdocs/
[Sat Oct 02 19:17:09 2004] [error] [client 67.70.121.62] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
[Sat Oct 02 19:17:23 2004] [error] [client 67.70.121.62] Directory index forbidden by rule: C:/Program Files/Apache Group/Apache2/htdocs/
[Sat Oct 02 19:17:23 2004] [error] [client 67.70.121.62] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
Display posts from previous:   
   Index -> General Discussion
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: