| Author |
|
exoiz Newbie

Joined: 01 June 2010
Online Status: Offline Posts: 6
|
| Posted: 01 June 2010 at 8:06am | IP Logged
|
|
|
I have a .htaccess for an Apache server and would like to use the code for an IIS server using the ISAPI Rewrite. How would I go about changing the below to work?
Code:
Options -Indexes Options +FollowSymlinks
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
<IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule>
DirectoryIndex index.php index.html |
|
|
Many Thanks
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 01 June 2010 at 8:24am | IP Logged
|
|
|
Do you want it to be changed to ISAPI_Rewrite v2 syntax? Or maybe it's version 3? Please specify.
Also please notice that if you have a choice please opt for ISAPI_Rewrite 3 as it's 99% Apache mod_rewrite compatible.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
exoiz Newbie

Joined: 01 June 2010
Online Status: Offline Posts: 6
|
| Posted: 01 June 2010 at 8:34am | IP Logged
|
|
|
I downloaded isapi_rwl_x86_0073.msi (Standard installation package) and installed it on a Windows 2003 Server (IIS 6.0). I'm not entirely sure what syntax I need?
I have a website written in PHP using the CodeIgniter Framework and it is currently on an Apache 2.2 server using mod_rewrite. I just need to use the same code on an IIS server using the same rewrite code.
Code:
[ISAPI_Rewrite]
RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] |
|
|
The above doesn't seem to work, any ideas?
Thanks
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 01 June 2010 at 9:12am | IP Logged
|
|
|
The first line is not needed in v3. All the rest should work fine:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Do you get an error?
__________________ Regards,
Anton
|
| Back to Top |
|
| |
exoiz Newbie

Joined: 01 June 2010
Online Status: Offline Posts: 6
|
| Posted: 01 June 2010 at 9:33am | IP Logged
|
|
|
I have two setups, the old code on the server which is on the root which works perfectly and the new code on the server which is in a sub folder and using rewrite and get the error message below.
You are not authorized to view this page You do not have permission to view this directory or page due to the access control list (ACL) that is configured for this resource on the Web server.
On another note should I have to add ISAPI_Rewrite as a Web Service Extension and set it to Allow?
Thanks
|
| Back to Top |
|
| |
exoiz Newbie

Joined: 01 June 2010
Online Status: Offline Posts: 6
|
| Posted: 01 June 2010 at 10:12am | IP Logged
|
|
|
The other message I am getting is below.
You are not authorized to view this page The URL you attempted to reach has an ISAPI or CGI application installed
that verifies user credentials before proceeding. This application
cannot verify your credentials.Do you have any ideas to what is configured incorrectly?
Thanks
|
| Back to Top |
|
| |
exoiz Newbie

Joined: 01 June 2010
Online Status: Offline Posts: 6
|
| Posted: 01 June 2010 at 10:22am | IP Logged
|
|
|
Figured out the above errors... NTFS security, which is now fixed :)
But my redirect is not working correctly, which is probably to do with my CodeIgniter set up rather than ISAPE Rewrite.
The page cannot be found HTTP Error 404 - File or directory not found.
|
| Back to Top |
|
| |
exoiz Newbie

Joined: 01 June 2010
Online Status: Offline Posts: 6
|
| Posted: 01 June 2010 at 10:36am | IP Logged
|
|
|
1) http://www.mysite.com/newsite/index.php?about 2) http://www.mysite.com/newsite/about
Number 1 works but the rewrite number 2 does not?
I have tried with both RewriteBase / and /newsite/
Code:
RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] |
|
|
I've tried all URI Protocols and assume AUTO should be okay?
URI PROTOCOL 'AUTO' 'PATH_INFO' 'QUERY_STRING' 'REQUEST_URI' 'ORIG_PATH_INFO'
Thanks
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 03 June 2010 at 3:10am | IP Logged
|
|
|
Let's try the following config:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php\?$1 [L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |