Redirect issues
Cross-posted to httpd
Running Apache 1.3.29 on Windows 2000
Have also tried Apache 2.0.48 on FreeBSD 5.0-RELEASE (Generic kernel)
My host uses Apache 1.3.27 on FreeBSD 4.8-STABLE (Custom kernel)
I use the following .htaccess
Which works a charm. I can visit all the links on the site, and they redirect as extected, and template.cgi spits out the correct info
If I goto test.domain.com I am presented with tings out of rht e/test/ directory, as expexted
If I try this locally, I'm presented with a 500-Internal server error. The error.log shows
My windows httpd.conf is as follows
File permissions don't allow me to view the httpd.conf on my hosts server
It would seem my rewrite rules are looping, but I can't see why it works on my host
Any ideas what I'm doing wrong?
Thanks
Ben
Running Apache 1.3.29 on Windows 2000
Have also tried Apache 2.0.48 on FreeBSD 5.0-RELEASE (Generic kernel)
My host uses Apache 1.3.27 on FreeBSD 4.8-STABLE (Custom kernel)
I use the following .htaccess
Redirect /index.shtml http://www.domain.com/index
ErrorDocument 403 /cgi-bin/error.cgi
ErrorDocument 404 /cgi-bin/error.cgi
ErrorDocument 500 /cgi-bin/error.cgi
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} test.domain.com
RewriteCond %{REQUEST_URI} !test/
RewriteRule ^(.*)$ test/$1 [L]
RewriteRule (photos) /cgi-bin/showphoto.cgi [QSA,L]
RewriteRule (prom) /cgi-bin/prom.cgi [QSA,L]
RewriteRule (about) /cgi-bin/template.cgi?page=about [QSA,L]
RewriteRule (change) /cgi-bin/template.cgi?page=change [QSA,L]
RewriteRule (main) /cgi-bin/template.cgi?page=index [QSA,L]
RewriteRule (index) /cgi-bin/index.cgi [QSA,L]
RewriteRule (links) /cgi-bin/template.cgi?page=links [QSA,L]
RewriteRule (staff) /cgi-bin/template.cgi?page=staff [QSA,L]Which works a charm. I can visit all the links on the site, and they redirect as extected, and template.cgi spits out the correct info
If I goto test.domain.com I am presented with tings out of rht e/test/ directory, as expexted
If I try this locally, I'm presented with a 500-Internal server error. The error.log shows
[Thu Dec 18 17:10:48 2003] [error] [client 127.0.0.1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.My windows httpd.conf is as follows
ServerType standalone
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MaxRequestsPerChild 0
ThreadsPerChild 50
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule dbm_auth_module modules/mod_auth_dbm.so
LoadModule digest_auth_module modules/mod_auth_digest.so
LoadModule digest_module modules/mod_digest.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
ClearModuleList
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_isapi.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_dbm.c
AddModule mod_auth_digest.c
AddModule mod_digest.c
AddModule mod_proxy.c
AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
ExtendedStatus On
Port 80
ServerAdmin admin@localhost
ServerName test.domain.com
DocumentRoot "C:/pub/home/domain/Live Copy/htdocs/"
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "C:/pub/home/domain/Live Copy/htdocs/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm
</IfModule>
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
#CacheNegotiatedDocs
UseCanonicalName On
<IfModule mod_mime.c>
TypesConfig conf/mime.types
</IfModule>
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups On
ErrorLog logs/error.log
LogLevel warn
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 logs/access.log combined
ServerSignature On
<IfModule mod_alias.c>
Alias /icons/ "C:/Program Files/Apache Group/Apache/icons/"
<Directory "C:/Program Files/Apache Group/Apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "C:/pub/home/domain/Live Copy/cgi-bin/"
<Directory "C:/pub/home/domain/Live Copy/cgi-bin/">
AllowOverride None
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_autoindex.c>
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
AddDescription "GZIP compressed document" .gz
AddDescription "tar archive" .tar
AddDescription "GZIP compressed tar archive" .tgz
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
</IfModule>
<IfModule mod_mime.c>
AddType application/x-tar .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddLanguage en .en
<IfModule mod_negotiation.c>
LanguagePriority en
</IfModule>
AddHandler cgi-script .cgi
AddType text/html .shtml
AddHandler server-parsed .shtml
</IfModule>
<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>
<Location /server-status>
SetHandler server-status
Order deny,allow
allow from 127.0.0.1
Deny from all
</Location>File permissions don't allow me to view the httpd.conf on my hosts server
It would seem my rewrite rules are looping, but I can't see why it works on my host
Any ideas what I'm doing wrong?
Thanks
Ben
