Mortgage - Loans - Loans - Photoshop Tutorials - Credit Cards

PDA

View Full Version : Unable to Maintain Subdomain in URL


TennisGuy
Aug 10th 2007, 9:23 am
I have created a subdomain and it sends the user to the correct DocumentRoot, however, they lose the subdomain in their URL. So they come to subdomain.MyDomain.com and end up at www.MyDomain.com/default.jsp. In viewing the http headers I can see that a 302 is returned to their browser with the Location: www.MyDomain.com/default.jsp. I cannot see anything in my httpd.conf file that would do this. Any thoughts? I've pasted my conf file below. Thanks.

<< httpd.con >>

ServerType standalone

ServerRoot "/usr/local/ecomm/apache"

PidFile /usr/local/ecomm/apache/logs/httpd.pid


ScoreBoardFile /usr/local/ecomm/apache/logs/httpd.scoreboard

Timeout 300

KeepAlive On

MaxKeepAliveRequests 0

KeepAliveTimeout 15

MinSpareServers 5
MaxSpareServers 10

StartServers 20

MaxClients 1300

MaxRequestsPerChild 10000


LoadModule env_module libexec/mod_env.so
LoadModule config_log_module libexec/mod_log_config.so
LoadModule mime_module libexec/mod_mime.so
LoadModule includes_module libexec/mod_include.so
LoadModule autoindex_module libexec/mod_autoindex.so
LoadModule dir_module libexec/mod_dir.so
LoadModule cgi_module libexec/mod_cgi.so
LoadModule alias_module libexec/mod_alias.so
LoadModule access_module libexec/mod_access.so
LoadModule auth_module libexec/mod_auth.so
LoadModule proxy_module libexec/libproxy.so
LoadModule usertrack_module libexec/mod_usertrack.so
LoadModule setenvif_module libexec/mod_setenvif.so
<IfDefine SSL>
LoadModule ssl_module libexec/libssl.so
LoadModule dynamo_module libexec/dynamoApache.so
</IfDefine>

ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_alias.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_proxy.c
AddModule mod_usertrack.c
AddModule mod_so.c
AddModule mod_setenvif.c
<IfDefine SSL>
AddModule mod_ssl.c
AddModule mod_dynamo.c
</IfDefine>

DynamoManager appServer1 30808
DynamoManager appServer2 30808
DynamoPath /ACTINT

Port 80

<IfDefine SSL>
Listen 1.2.3.4:80
Listen 1.2.3.4:8080
Listen 1.2.3.4:443
</IfDefine>

User someuser
Group somegroup

ServerAdmin webadmin@mydomain.com

ServerName www.mydomain.com


DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app

<Location ~ "/ACTINT/(TicketValidatorServlet|UserRegistrationServlet|AccountVerificationServlet|OrderStatusQueryServlet)">
AuthName "Authorized Access Only"
AuthType Basic
AuthUserFile /usr/local/ecomm/apache/users
require valid-user
</Location>

<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/usr/local/www/v5/main57/j2ee-apps/web-app">

<IfModule mod_rewrite.c>

RewriteEngine off
Options FollowSymLinks
</IfModule>

AllowOverride None
Order allow,deny
Allow from all
</Directory>

DirectoryIndex default.jsp

AccessFileName .htaccess

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

UseCanonicalName On

TypesConfig /usr/local/ecomm/apache/conf/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
MIMEMagicFile /usr/local/ecomm/apache/conf/magic
</IfModule>

HostnameLookups Off

ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/error.%Y%m%d"

LogLevel error

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /usr/local/ecomm/apache/logs/access_log common

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" cookie_combined
CustomLog "| /usr/local/apache/bin/cronolog --period '12 hours' /usr/local/ecomm/apache/logs/access2.%Y%m%d0000.%H" cookie_combined

ServerSignature On

<IfModule mod_alias.c>

Alias /icons/ "/usr/local/ecomm/apache/icons/"

<Directory "/usr/local/ecomm/apache/icons">
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /jolt /usr/local/jolt/client/

ScriptAlias /cgi-bin "/usr/local/www/v5/main57/j2ee-apps/web-app/cgi-bin"
<Directory "/usr/local/www/v5/main57/j2ee-apps/web-app/cgi-bin">
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</IfModule>
Redirect /directory/file1.html http://www.mydomain.com
Redirect /job/file.html http://www.mydomain.com/about/careers/default.jsp
Redirect /store/st.html http://www.mydomain.com
Redirect /loc/sl.html http://www.mydomain.com/locator/find.jsp
Redirect /sundayad http://www.mydomain.com/store/ad/default.jsp
Redirect /hm.html http://www.mydomain.com
Redirect http://www.mydomain.com/store/list.jhtml http://www.mydomain.com/shopping/list.jsp
Redirect http://www.mydomain.com/qr/register.jhtml https://www.mydomain.com/qr/register.jsp
Redirect http://www.mydomain.com/whctv/default.jsp http://stuff.mydomain.com/display/router.aspx
RedirectMatch (.*)/cgi-bin/mqlocator(.*)$ http://www.mydomain.com/locator/find.jsp

IndexOptions FancyIndexing

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README
HeaderName HEADER

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

<IfModule mod_mime.c>

AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .ee
AddLanguage fr .fr
AddLanguage de .de
AddLanguage el .el
AddLanguage he .he
AddCharset ISO-8859-8 .iso8859-8
AddLanguage it .it
AddLanguage ja .ja
AddCharset ISO-2022-JP .jis
AddLanguage kr .kr
AddCharset ISO-2022-KR .iso-kr
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddCharset ISO-8859-2 .iso-pl
AddLanguage pt .pt
AddLanguage pt-br .pt-br
AddLanguage ltz .lu
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage zh-tw .tw
AddLanguage tw .tw
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8

<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
</IfModule>

AddType application/x-tar .tgz


</IfModule>

<FilesMatch "\.(pdf|gif|jpg|jpeg)$">
ErrorDocument 302 /request_error.jsp
ErrorDocument 403 /request_error.jsp
ErrorDocument 404 /request_error.jsp
ErrorDocument 500 /request_error.jsp
ErrorDocument 501 /request_error.jsp
ErrorDocument 505 /request_error.jsp
</FilesMatch>

<Directory />
ErrorDocument 403 /request_error.jsp
ErrorDocument 404 /request_error.jsp
ErrorDocument 500 /downtime.htm
</Directory>


<IfModule mod_setenvif.c>

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

</IfModule>


<IfDefine SSL>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
</IfDefine>

<IfModule mod_ssl.c>

SSLPassPhraseDialog builtin
SSLSessionCache dbm:/usr/local/ecomm/apache/logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:/usr/local/ecomm/apache/logs/ssl_mutex

SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog /usr/local/ecomm/apache/logs/ssl_engine_log
SSLLogLevel error

</IfModule>

<IfDefine SSL>

<VirtualHost 1.2.3.4:443>

DocumentRoot "/usr/local/www/v5/main57/j2ee-apps/web-app"
ServerName www.mydomain.com
ServerAdmin user@myserver
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/error.%Y%m%d"
CustomLog "| /usr/local/apache/bin/cronolog --period '12 hours' /usr/local/ecomm/apache/logs/access2.%Y%m%d0000.%H" cookie_combined
RedirectMatch ^/(.*)\.jhtml$ https:/$1.jsp

SSLEngine on

SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM

SSLCertificateFile /usr/local/apache/conf/ssl/temp/mycer.cer
SSLCertificateKeyFile /usr/local/apache/conf/ssl/temp/secureprivate.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/ecomm/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

<Location ~ "/ACTINT/(TicketValidatorServlet|UserRegistrationServlet|AccountVerificationServlet)">
AuthName "Authorized Access Only"
AuthType Basic
AuthUserFile /usr/local/ecomm/apache/users
require valid-user
</Location>

</VirtualHost>

</IfDefine>

NameVirtualHost 1.2.3.4:80

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex default.jsp
ServerName www.mydomain.com
ServerAlias mydomain.com
CustomLog "| /usr/local/apache/bin/cronolog --period '12 hours' /usr/local/ecomm/apache/logs/access2.%Y%m%d0000.%H" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/error.%Y%m%d"
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app/anotherdomain
DirectoryIndex index.html
ServerName www.anotherdomain.com
ServerAlias anotherdomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/anotherdomain_access.%Y%m%d0000" cookie_combined
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex stillanotherdomain/default.jsp
ServerName www.stillanotherdomain.com
ServerAlias stillanotherdomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/stillanotherdomain_access.%Y%m%d0000" cookie_combined
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex store/subdomain/default.jsp
ServerName www.subdomain.mydomain.com
ServerAlias subdomain.mydomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/resource_access.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/resource_error.%Y%m%d"
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex spanish/default.jsp
ServerName www.mydomaininspanish.com
ServerAlias mydomaininspanish.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/spanish_access.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/spanish_error.%Y%m%d"
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex about/careers/default.jsp
ServerName www.mydomain.jobs
ServerAlias mydomain.jobs
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/jobs_access.%Y%m%d0000" cookie_combined
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex library/centers/diabetes/default.jsp
ServerName www.stillyetanotherdomain.org
ServerAlias stillyetanotherdomain.org
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/moredomains_access.%Y%m%d0000" cookie_combined
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex library/centers/diabetes/default.jsp
ServerName www.stillyetanotherdomain.net
ServerAlias stillyetanotherdomain.net
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/moredomains_unsecure.%Y%m%d0000" cookie_combined
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex cool/default.jsp
ServerName cool.mydomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/cool_access2.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/cool.error.%Y%m%d"
RedirectMatch ^/(.*)\.jhtml$ http:/$1.jsp
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app/diversity
DirectoryIndex default.html
ServerName diversity.mydomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/diversity_access2.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/diversity.error.%Y%m%d"
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app/worksite
DirectoryIndex default.html
ServerName www.onemoredomain.com
ServerAlias onemoredomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/onemoredomain_access.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/onemoredomain.error.%Y%m%d"
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex cgi-bin/redirect.cgi
ServerName anotherdomainwehost.com
ServerAlias www.anotherdomainwehost.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/anotherdomainwehost.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/anotherdomainwehost.error.%Y%m%d"
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex cgi-bin/anotherRedirect.cgi
ServerName mydifferentdomain.com
ServerAlias www.mydifferentdomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/mydifferentdomain.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/mydifferentdomain.error.%Y%m%d"
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerAdmin webadmin@mydomain.com
DocumentRoot /usr/local/www/v5/main57/j2ee-apps/web-app
DirectoryIndex subdomainwithproblems/default.jsp
ServerName subdomainwithproblems.mydomain.com
ServerAlias subdomainwithproblems.mydomain.com
CustomLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/subdomainwithproblems_access.%Y%m%d0000" cookie_combined
ErrorLog "| /usr/local/apache/bin/cronolog /usr/local/ecomm/apache/logs/subdomainwithproblems_error.%Y%m%d"
</VirtualHost>

DynamoDebug true

TennisGuy
Aug 14th 2007, 9:52 am
Turns out there is a configuration file on the application server that automatically returns a 302 redirect to the main domain if the subdomain that comes in isn't in that config file.