I am having a problem with a regular expression for .htaccess on a Godaddy shared server. Here is the .htaccess file.
--------------
Options Includes FollowSymLinks Multiviews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.co\.sa [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^.*$ http://www.example.co.sa/$1 [R=301]
#RewriteRule ^([A-Za-z0-9-]+).html index.php?pg=$1 [L]
#RewriteRule ^(([A-Za-z0-9\-]+/)*[A-Za-z0-9\-\/]+)?$ $1.php [NC,C]
RewriteRule ^forum/topics/[A-Za-z0-9-\/]+/(\d+) view-forum-topics.php?intId=$1 [NC,L]
RewriteRule ^forum/posts/[A-Za-z0-9-\/]+/(\d+)/(\d+) view-forum-posts.php?intCatId=$1&intId=$2 [NC,L]
Allow from all
--------------
Here is my error message:
[Sun Aug 15 19:33:44 2010] [alert] [client #*$!.#*$!.#*$!.#*$!] /virtual/path/example/.htaccess: RewriteRule: cannot compile regular expression '^forum/topics/[A-Za-z0-9-\\/]+/(\\d+)'\n
It appears that when I escape the forward slash in [A-Za-z0-9-\/] it won't compile. The purpose of the expression is to rewrite any directory path to a php file (see RewriteRule above). It is supposed to match the digits at the end for use in the php file.
The site is currently being hosted on a different system and the administrator gave me what is working on his system albeit the Rewrite Rule is written for a virtual host file (under the <Directory> tag, not a .htaccess file.
Has someone seen this before and know how to make it work?
Thanks,
Erik