Issue with dash in map name

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 34
Joined: 19 Feb 2013, 11:44

Issue with dash in map name

29 Jan 2015, 08:57

In an attempt to help figure this out I have included the error message, my htaccess file and my configuration file.

The url I am having an issue with is http://www.example.com/film-tv/products/lighting/index.asp

Its actually all rewritten urls that start with http://www.example.com/film-tv/

There were 4 different map files used on my site, "lighting", "audio", "rigging" and "video". Each one has its own category map db. This system works, it has been for a couple of years. We have added a new one, "film-tv", and it is this that is causing problems.

Here is an example rule that doesn't work with "film-tv":

Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${$1_map_dbd:$2|NOT_FOUND} !NOT_FOUND
RewriteRule ^([^?/]+)/products/([^?/]+)(/)?(index\.asp)?$ cat2.asp?div=${cat_map_dbd:$1}&cat2=${$1_map_dbd:$2} [NC,QSA,L]


As you can see, its dynamically creating the required map file based on the first parameter in the url. It seems that the "-" is making it think it needs to do a subtraction. Is there any way I can stop this? I need to keep "film-tv" in the url.

Hopefully I have provided enough information for you, if not, let me know and I will do what I can.

Cheers,

Steve
Attachments
500.txt
(4.76 KiB) Downloaded 1581 times
httpd.txt
(6.64 KiB) Downloaded 1566 times
htaccess.txt
(23.31 KiB) Downloaded 1565 times

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Issue with dash in map name

29 Jan 2015, 09:55

Hello,

"As you can see, its dynamically creating the required map file based on the first parameter in the url. It seems that the "-" is making it think it needs to do a subtraction. Is there any way I can stop this? I need to keep "film-tv" in the url."
- Have you tried hardcoding "film-tv" part of mapfile name and testing it with a static rule written specifically for film-tv_map_dbd? Just for testing. Chances are that dash is not a valid character for mapfile name.

User avatar
Posts: 34
Joined: 19 Feb 2013, 11:44

Re: Issue with dash in map name

29 Jan 2015, 10:23

Hi Anton,
I just tried this:

Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${film-tv_map_dbd:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^film-tv/products/([^?/]+)(/)?(index\.asp)?$ cat2.asp?div=1316&cat2=${film-tv_map_dbd:$1} [NC,QSA,L]


Got the same error message. But when I changed the map name I was getting the same error. I then started to look elsewhere for the dash, and realised it was in my view name in the sql. Renamed my view and its now working correctly, even with the dash in the map name.

So, the lesson here is that no dashes in sql.

Cheers,

Steve

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 27 guests