RewriteRule problem

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 16 Apr 2013, 03:08

RewriteRule problem

16 Apr 2013, 03:24

Hi everybody.
I have problem with RewriteRule (ISAPI Lite , IIS 6).
I have several websites on IIS and want to add rules for one page www.domain.pl

The first part (non www to www) works great.
The second part (friendly links) doesn't work.
This is my httpd.conf:

RewriteEngine On
RewriteCond %{HTTP_HOST} .*domain.pl
RewriteCond %{HTTP_HOST} !^www\.domain\.pl
RewriteRule (.*) http://www.domain.pl$1 [R=301,L]


RewriteCond %{HTTP_HOST} .*domain.pl
RewriteRule ^o_firmie.html$ index.php?id_strony=1 [NC,L,QSA]

Can you tell my what i do wrong?

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: RewriteRule problem

16 Apr 2013, 09:12

Please fix your rules like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} .*domain\.pl
RewriteCond %{HTTP_HOST} !^www\.domain\.pl
RewriteRule (.*) http://www.domain.pl$1 [R=301,L]


RewriteCond %{HTTP_HOST} .*domain\.pl
RewriteRule ^/o_firmie.html$ /index.php?id_strony=1 [NC,L,QSA]

User avatar
Posts: 3
Joined: 16 Apr 2013, 03:08

Re: RewriteRule problem

16 Apr 2013, 09:39

Thank You for response.
Still no result.
Here is log:
(2) init rewrite engine with requested uri /index.php?id_strony=1
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '(.*)' to uri '/index.php'
(4) RewriteCond: input='www.domain.pl' pattern='.*domain\.pl' => matched
(4) RewriteCond: input='www.domain.pl' pattern='!^www\.domain\.pl' => not-matched
(3) applying pattern '^/o_firmie.html$' to uri '/index.php'

Any suggestions?

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: RewriteRule problem

16 Apr 2013, 10:55

Hello,

What request do you make? The part of the log you show tells that you request /index.php?id_strony=1, while I believe you are supposed to request /o_firmie.html and get the content of /index.php?id_strony=1 with the help of rewriting. Please clarify.

User avatar
Posts: 3
Joined: 16 Apr 2013, 03:08

Re: RewriteRule problem

17 Apr 2013, 03:12

Of course you are right!
My mistake. Thank you for your help in solving my problem.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 16 guests