Migrating from Apache to IIS - trouble with code

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 12 Jan 2013, 10:36

Migrating from Apache to IIS - trouble with code

15 Jan 2013, 12:24

Hi.

I´ve recently switched from a Linux server to a Win server and started using IR 3 on one of my domains, but I´m having some trouble. I simply don´t know how to translate my original Apache .htaccess file to have it working perfectly under IR 3.

Here is my original script:

-----------------------------------------------
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.86

RewriteEngine On
RewriteCond %{HTTP_HOST} ^concurseirosocial.com.br [NC]
RewriteRule ^(.*)$ http://www.concurseirosocial.com.br/$1 [L,R=301]

#
# Full path to your site
#

RewriteBase /

# Rename Photo Names
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)_([0-9]*?)\.(.*)$ file/pic/photo/$1/$2/$3_$5.$6
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)\.(.*)$ file/pic/photo/$1/$2/$3.$5

#
# Rules
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?do=/$1

# Image Access Protection
# RewriteRule ^file/pic/photo/(.*)\.(.*)$ static/image.php?file=$1&ext=$2


# Modify Headers
<IfModule mod_headers.c>
# Cache files
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
Header set Expires "Mon, 20 Apr 2015 20:00:00 GMT"
Header unset Last-Modified
</FilesMatch>

# Cache JavaScript & CSS
<FilesMatch "\.(js|css)$">
Header set Cache-Control "public"
Header set Expires "Mon, 20 Apr 2015 20:00:00 GMT"
Header unset Last-Modified
</FilesMatch>
</IfModule>

# Compress JavaScript & CSS
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
-----------------------------------------------

One of the main problems consists in redirect non www pages to www pages. If I type concurseirosocial.com.br/video/, I´m redirected to default 404 page, not to http://www.concurseirosocial.com.br/video/

The second one is:
if I type concurseirosocial.com.br/video/ directly into the address bar I reach the 404 page, and every page I click in the main menu, the adress still remains the first one (concurseirosocial.com.br/video/), instead of that wich was clicked.

I´ll be very grateful with your assistance.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Migrating from Apache to IIS - trouble with code

15 Jan 2013, 21:35

Hello,

Let's see if ISAPI_Rewrite works at all and if yes, than how it processes the requests.
Logging issues are described in FAQ.

So just enable the logging, fire a request and provide us with the log.

Regards
Andrew

User avatar
Posts: 2
Joined: 12 Jan 2013, 10:36

Re: Migrating from Apache to IIS - trouble with code

16 Jan 2013, 16:44

Ok, Andrew. Thanks for the response.

I did enabled the log writing as on FAQ. But how to send it to you? Any mail or form?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Migrating from Apache to IIS - trouble with code

17 Jan 2013, 01:27

You can provide it here... it's not supposed to be big. Or you can email or use helpdesk. Just mark the title "To Andrew"

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 42 guests