Add .html at the end of url

hi all


RewriteRule ^-(.+?)-(.+?)-(.+?) index.php?s=$1&d=$2&i=$3

The above code works fine and gives me result as


index-1-2-3

now i want to add “productname.html” at end of it like


index-1-2-3-productname.html

If i use the below code then my result query doesnt works


^-(.+?)-(.+?)-(.+?)\\.html$

vineet

vineet,


RewriteRule ^-(.+?)-(.+?)-(.+?) index.php?s=$1&d=$2&i=$3

… will NOT match (and then redirect) index-1-2-3 as you stated. The leading - will prevent that.

Rather than waffle through your coding attempts (and whine at you about why your code is inadvisable), let me refer you to the mod_rewrite tutorial linked in my signature as, IMHO, you need to learn some proper regular expression syntax in order to achieve your goals.

Regards,

DK

thanks dk

its a nice article to read and learn

vineet

vineet,

If you have questions, you know where to find me. Now, after you’ve learned some regex, please show your code again and I’ll be happy to help you get where you want.

Regards,

DK