Forum Moderators: phranque
Now, in Apache 2.0 they actually check to see if the page name exists in either our public or private docs folder before running the page with the script alias appended. This causes a HUGE problem as we were running some dynamic pages where the page names didnt actually exist, the script was figuring out what content to deliver based on the page name. Now we have to put a bogus placeholder "filename.html" for each page that was previously dynamic in Apache 1.x and it's making a big mess.
I came up with one solution which was to override "ErrorDocument 404" and redirect it to my dynamic page generator, which worked well for browsers but the search engines still see the 404 and won't crawl the page.
Banging head on wall - any ideas?
Here's the script....
RewriteEngine On
RewriteCond /home/httpd/vhosts/domain.com/httpdocs/%{REQUEST_FILENAME} -f
RewriteRule ^(.+) /home/httpd/vhosts/domain.com/httpdocs/$1 [L]
RewriteCond /home/httpd/vhosts/domain.com/private/%{REQUEST_FILENAME} -f
RewriteRule ^(.+) /home/httpd/vhosts/domain.com/private/$1 [L]
RewriteRule ^(.+) - [PT]
ScriptAlias /cgi-bin/ "/home/httpd/vhosts/domain.com/cgi-bin/"
<Directory "/home/httpd/vhosts/domain.com/cgi-bin/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
<Directory "/home/httpd/vhosts/domain.com/httpdocs/">
DirectoryIndex home.html index.htm index.html default.htm Default.htm
Action cgi-webc /cgi-bin/somescript.cgi
AddHandler cgi-webc html
Options ExecCGI Includes MultiViews
AddHandler default-handler .gif
AddHandler default-handler .jpg
</Directory>
<Directory "/home/httpd/vhosts/domain.com/private/">
DirectoryIndex index.htm index.html default.htm Default.htm
Action cgi-webc /cgi-bin/somescript.cgi
AddHandler cgi-webc html
Options ExecCGI Includes MultiViews
AddHandler default-handler .gif
AddHandler default-handler .jpg
</Directory>