Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite question

mod rewrite question

         

delchai

7:26 pm on Oct 26, 2007 (gmt 0)

10+ Year Member



Hi,

Im just getting into mod rewrite and am having some issues.

I have a URL that looks similar to

http://example.com/product/product-name?page=2

I would like it to look like this

http://example.com/product/product-name/2/

I am using the following snippet to hide my PHP extensions...

RewriteEngine on
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME}!-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

And tried adding this:
RewriteRule /product/([A-Z¦a-z¦0-9¦\-¦\_]*)\?page=([0-9]*) /product/$1/$2/

But I get a "no input file specified" error when I try it. Does anybody know how I could solve this?

g1smd

7:43 pm on Oct 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Check through the posts from the last few days here.

I am sure that a very similar question was asked and answered only yesterday or the day before.

Your rule is back to front. The links on your page need to use the new style "foldered" URLs. The RewriteRule then simply takes that URL request and translates it into the internal server filepath where that content actually resides.

delchai

8:14 pm on Oct 26, 2007 (gmt 0)

10+ Year Member



oops! I had it backwards. I feel slighty sheepish. I've got it working just great now. Thanks!