Saikios
Saikios

Reputation: 3711

Error when converting a web.config to .htaccess in rewrite

I'm migrating a server, it was all php but it was on a windows server (don't know why, but it is what it is :P)

  <rule name="category2" stopProcessing="true">
     <match url="^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_ -]+)" ignoreCase="false" />      
     <action type="Rewrite" url="listbycategory.php?id={R:1}&amp;pagenumber={R:2}" />" />
  </rule>

I tried with:

Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_ -]+)/?$ listbycategory.php?id=$1&amp;nroPagina=$2

But the world explodes, any clues on what i'm making a mess?

Upvotes: 0

Views: 239

Answers (1)

Jan-Henk
Jan-Henk

Reputation: 4874

You should escape the space in your rewrite rule, so change your rewrite rule line into:

RewriteRule ^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_\ -]+)/?$ listbycategory.php?id=$1&amp;nroPagina=$2

Note the \ before the space.

By the way, is it on purpose that you changed the pagenumber variable into nroPagina?

Upvotes: 1

Related Questions