Forum Moderators: phranque
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?
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.