I am not exactly sure whats wrong, most-likely my htaccess is wrong. In any event there are two files on server one called “club.php” and other called “image.php” the club.php is re-written to look like a directory as such ex; club1
the url would look like this without re-write ex; club.php?cid=1 cid being club id
now the image.php file goal is to call an image from database via path and to display it to user without exposing actual image path on the server.
For this there are two values that are passed into query “cid” and “type”. The problem with my current htaccess is that anytime there is a backslash added to the club1 it stops working and displaying data same happens for image.php which no longer works as well.
Since i am using club1/some-page-name style architecture backslashes are required. But sadly they don’t work with my current re-write rules.
Here is my current htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^club([0-9]+) index.php?clubID=$1 [L]
RewriteRule ^image/_header([0-9]+)_([0-9]+) image.php?cid=$1&type=$2 [L]
<IfModule mod_env.c>
SetEnv SEO_SUPPORT 1
</IfModule>
</IfModule>
Could some one point out what I am doing wrong and what I can do to fix the backslash issue. Thank you kindly in advance.
File Tree
http://localhost/dev1
- index.php
- image.php
- club.php
- .htaccess
-> php
- db.class.php
- functions.class.php
-> css
- menu.css
-> js
- html5handler.js
-> uploads
Found the problem. The problem was with the fact as /page was being added to the url after club# it forced the image script to point to the main directory instead of its test directory /dev1 so the url would have became
image/_header1_4 instead they needed to be dev1/image/_header1_4
So in the end this was not the htaccess problem