Link to home
Start Free TrialLog in
Avatar of kennedypd1
kennedypd1

asked on

Mod rewrite

HI

I am just starting out using this and thought I had my head around it so was just trying to do the most basic task but not working and I dont understand why.

.htaccess

RewriteEngine On    # Turn on the rewriting engine
RewriteRule ^items-starting-with-a/$   browse_categories.php?search_string=A    [NC,L]    # Handle requests for "A"

URL
http://domain.com/items-starting-with-a/

Server Error
The requested URL /var/users/userid/domain.com/htdocs/browse_categories.php was not found on this server.

Checked
manually type in domain.com/browse_categories.php and it delivers the page fine as does domain.com/browse_categories.php?search_string=A

Anyone got any ideas where I am heading wrong here
Any help appreciated
Paul
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kennedypd1
kennedypd1

ASKER

Hi Ray

Thanks I have worked it out.

I had to change the rule to have a slash infront of the page name like below.

RewriteEngine On    # Turn on the rewriting engine
RewriteRule ^items-starting-with-a/$   /browse_categories.php?search_string=A    [NC,L]    # Handle requests for "A"

Cheers
Paul
Looks good!  Thanks for the points, ~Ray