I have a cgi script installed in my main cgi-bin. And I can run the script by directly linking to the script (www.mydomain.com/cgi-bin/script.cgi). And I can call the script via ssi on all my .shtml pages that aren't in a subdomain. But when it comes to my subdomains, I get the error message: an error occurred while processing this directive. To call the script I'm using: <!--#include virtual="/cgi-bin/b3fmail/b3fmail.cgi?action=getform&form=test" -->
To get to the page where I've placed the code, if I type the url as www.mydomain.com/subdomain/file.shtml everything works fine. But when I type it as www.subdomain.mydomain.com/file.shtml I get the same error message as before (everything else on the page is fine though).
Shouldn't both urls work the same and lead to the same place?
## the root domain
ServerName www.domain.com
DocumentRoot /home/domain/html
# the subdomain
ServerName sub.domain.com
DocumentRoot /home/domain/sub/html
ScriptAlias /cgi-bin /home/domain/cgi-bin/
See [httpd.apache.org...] for more info.
Another question:
Every time I use a file manager to edit the page with the ssi script, it keeps adding amp; to the script. It starts looking something like below
<!--#include virtual="../cgi-bin/b3fmail/b3fmail.cgi?action=getform&amp;amp;amp;amp;form=test" -->
I have to keep deleting each amp; or else the script won't work. Why does amp; keep inserting itself?
The file has no name, just the extension htaccess
Glad I'm not the only one who mixes up filenames :)
I have never tried this in .htaccess (only in httpd.conf) but I think the following should work.
This one line idea assumes that your subdomains have been configured elsewhere for the rest, and your server does indeed support mod_alias.
Create a file in a text editor called .htaccess and add only the following line to it:
ScriptAlias /cgi-bin /home/domain/cgi-bin/
Where "/home/domain/cgi-bin/" is the path to the cgi-bin of the main domain
Upload the .htaccess file to the html root of your subdomain. If it has worked you can now use the same virtual includes on your main domain and on the subdomain (with the same path to the script).