1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help with htaccess

Discussion in 'Programming' started by hostguost, Feb 13, 2020.

  1. #1
    I have an old perl webmail script that works perfectly and provides a webmail service such as yahoo or gmail. It was originally sold under two brand names but became open source under the gnu licence. Both brands work well but the jilmail brand has html links that rely on a .htaccess redirect which does not work.
    I assume that the way htacess files are written has changed over the years.
    The actual location of a file on the server might be:
    public_html/cgi-bin/inbox.htm but the html link would be written xemail?Inbox; where no such folder or file as xemail exists.
    So anything prefixed with xemail redirects to the equivalent file in the cgi-bin folder.
    This is the existing htaccess file:

    RewriteEngine On
    Allow all
    RewriteRule ^xemail$ /cgi-bin/mail/jilmail.cgi [L]
    RewriteRule ^domail$ /cgi-bin/mail [L]
    But that gives a page 500 error. I can't find any reference to this type of redirect on the apache site, how would I achieve the desired result using a modern htaccess?
    hostguost, Feb 13, 2020 IP
  2. NetStar

    NetStar Notable Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Do you even understand what the .htaccess is doing?
    It's saying if someone requests "xemail" then to map it to "/cgi-bin/mail/jilmail.cgi" and execute that script. So for example... if a visitor goes to mydomain.etc/xemail the server will execute the script located at /cgi-bin/mail/jilmail.cgi to use and the [L] means stop looking at the other rules after the match has been made.
    If the HTACCESS does not work first try going to mydomain.etc/xemail. If that does not work then try going to mydomain.etc/cgi-bin/mail/jilmail.cgi. If that does not work where the hell is jilmail.cgi located?

    If you received a 500 error then there's a good chance it worked but there's a technical error in your Perl script. Did you CHMOD 0755? Debug the Perl script to find the error.
    NetStar, Feb 24, 2020 IP