Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008

    .htaccess issue with Apache 1.3, but works on Apache 2.2

    I have the following Apache redirect code in .htaccess:

    RewriteRule ^sap-latest-news/([0-9]*)/([A-Za-z0-9_\-.]*).htm$ /$1 [L]

    This redirect works fine on Apache 2.2.8, but doesn't work on Apache 1.3.41

    The following is the entry from error_log:
    RewriteRule: cannot compile regular expression '^sap-latest-news/([0-9]*)/([A-Za-z0-9_\\-.]*).htm$'\n

    A simple Rewrite is working fine in Apache 1.3, but the above regualar expression doesn't seem to be working on Apache 1.3. Does anyone know whether Apache 1.3 doesn't support it?

  2. #2
    char "." it's any symbol

    Try to use

    ... \\-.]*)\.htm$ ...
    in plcae of
    ... \\-.]*).htm$ ...

  3. #3
    Join Date
    Feb 2008
    Thank you for the suggestion, but I still get the error:

    [Sun Mar 23 02:06:43 2008] [alert] [client IP] /home/saper/public_html/.htaccess: RewriteRule: cannot compile regular expression '^sap-latest-news/([0-9]*)/([A-Za-z0-9_\\-.]*)\\.htm$'\n

  4. #4
    Join Date
    Apr 2000
    While the actual character check for the . dot on \.htm$ is a good idea, it will not create an error. You do need to backwack the . in the character class though:

    RewriteRule ^sap-latest-news/([0-9]*)/([A-Za-z0-9_\-\.]*)\.htm$ /$1 [L]

    Note that:


    Is now:


    That should fix the error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts