I'm pretty a new comer to while using RewriteRule, and so i am likely missing something apparent, but I've got a PHP script that can take URL variables such as this:


I must create RewriteRules to ensure that anybody who types within this script title/variable combo might have their URL rewritten to:


In addition to making certain that anybody who types within the flat-link url, really calls the script using the right variable title and cost.

I've been mentioning to this link and I've discovered related threads:

Mod_rewrite flat links

Mod_rewrite trouble: Want to direct from ?= to a flat link, nothing seems to work.

But, I'm clearly doing a problem, when i cannot understand this Hyperlink to work generate an income want. I'm presently while using following code, which seems to complete nothing (apart from spinning the Hyperlink to range from the www, and redirect demands for index.php towards the site root):

RewriteEngine ON
RewriteCond %{HTTP_HOST} ^baseurl.com$ [NC]
RewriteRule ^(.*)$ http://www.baseurl.com/$1 [R=301,L]
RewriteRule ^index.php / [R=301,L]
RewriteRule ^properties/([0-9A-Za-z]+)/$ /properties.php?prop=$1

The problem is clearly using the last RewriteRule, presuming nothing above has effects on it. Again, I'm likely doing something absurd. Can someone please explain things i am doing wrong?

Interesting help.

In a quick glance, it seems that you simply didn't remember to incorporate the dash inside your regular expression and also you incorporated trailing slash. Make use of this rather:

RewriteRule ^properties/([0-9A-Za-z-]+)$ /properties.php?prop=$1

Should you review your rule ^properties/([0-9A-Za-z]+)/$ the thing is that it must finish having a forward slash. You may either remove that or allow it to be optional like ^properties/([0-9A-Za-z]+)/?$.