Unwanted %3c

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 30 Oct 2014, 06:28

Unwanted %3c

30 Oct 2014, 06:40

Hi

I recently installed ISAPI rewrite on IIS8 to accomodate an ExpressionEngine website that was on an Apache server.

I had rewrite problems but after installing ISAPI all worked well apart from the links between the language selection.

I have 2 languages English and Norwegian. When I select the English link I get http://xxx.xx.xxx.xx:xxx/en%3C? echo $url; ?> and for Norwegian http://xxx.xx.xxx.xx:xxx/no%3C? echo $url; ?>.

All the other links are being rewritten perfectly.

Any suggestions as to why the %3c is not being parsed as <

Thanks

Chris

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

Re: Unwanted %3c

30 Oct 2014, 07:13

Hello, Chris

Please show the rules which get matched for the mentioned requests.
Also, please try to use NE flag after these rules.

User avatar
Posts: 5
Joined: 30 Oct 2014, 06:28

Re: Unwanted %3c

30 Oct 2014, 07:36

Hi Anton

The rule I am using is

# rewrite rules
RewriteEngine On

# ditch index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /en/index.php/$1 [L]

ErrorDocument 404 /errors/not_found.html

And the equivalent for Norwegian

# rewrite rules
RewriteEngine On

# ditch index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /no/index.php/$1 [L]

ErrorDocument 404 /errors/not_found.html

I tried the NE flag but maybe I have it in the wrong place. I am very new to this

Chris

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

Re: Unwanted %3c

30 Oct 2014, 07:44

Hello, Chris

Where do you have these two configs which only differ in the language marker?
NE should be put together with L like this: [NE,L]
If it doesn't help, please provide rewrite.log records for the test request.
P.S. To enable logging put

RewriteLogLevel 9

into httpd.conf in installation folder.

User avatar
Posts: 5
Joined: 30 Oct 2014, 06:28

Re: Unwanted %3c

30 Oct 2014, 08:19

Hi,

I have a root directory with one .htaccess file

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.104

# rewrite rules
RewriteEngine On

# ditch index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [NE,L]

ErrorDocument 404 /error/not_found.html


And then subdirectories en and no with the rewrite rules

# rewrite rules
RewriteEngine On

# ditch index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /en/index.php/$1 [NE,L]

ErrorDocument 404 /errors/not_found.html

I am trying the log and will send when I can

Chris

User avatar
Posts: 5
Joined: 30 Oct 2014, 06:28

Re: Unwanted %3c

30 Oct 2014, 10:01

Anton,

Attached is the rewrite.log. I hope this means more to you than me

Chris
Attachments
Rewrite.log
(53.79 KiB) Downloaded 1323 times

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

Re: Unwanted %3c

31 Oct 2014, 08:24

Hello, Chris

Apparently, RewriteRule does not even match the URL such as http://xxx.xx.xxx.xx:xxx/en or http://xxx.xx.xxx.xx:xxx/no because the check for folder existence fails, so it's very unlikely that the problem is related to ISAPI_Rewrite.

I also want to suggest you using the following config in your root .htaccess and not putting anything in the language subfolders:

# ditch index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(?:en|no)
RewriteRule ^(.*)$ /index.php/$1 [NE,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/en
RewriteRule ^(.*)$ /en/index.php/$1 [NE,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/no
RewriteRule ^(.*)$ /no/index.php/$1 [NE,L]

User avatar
Posts: 5
Joined: 30 Oct 2014, 06:28

Re: Unwanted %3c

03 Nov 2014, 11:38

Thanks Anton,

That solution didn't work but I am begining to believe that is the way the website is configured.

Thanks for your help

Chris

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 5 guests