2012-06-26 9 views
2

я только что создал веб-сайт с CodeIgniter, проблема была с нашим сервером, который работает на Windows Server 2003 с IIS6,Настройка Htaccess для работы с IIRF на IIS6 - CodeIgniter

при вызове веб-сайт отображает только домашнюю, а на других страницах отображается страница с ошибкой 404 из-за ограничения на .htaccess на IIS6,

поддержка сообщила мне, что он сделал установку для программы под названием IIRF, чтобы включить moderewrite, но все же мне нужно использовать другое выражение перезаписи, которое было в htaccess

вот мой контент htaccess

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /root/ 

#Removes access to the system folder by users. 
#Additionally this will allow you to create a System.php controller, 
#previously this would not have been possible. 
#'system' can be replaced if you have renamed your system folder. 
RewriteCond %{REQUEST_URI} ^mvc/core_business.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

#When your application folder isn't in the system folder 
#This snippet prevents user access to the application folder 
#Submitted by: Fabdrol 
#Rename 'application' to your applications folder name. 
RewriteCond %{REQUEST_URI} ^mvc.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

#Checks to see if the user is attempting to access a valid file, 
#such as an image or css document, if this isn't true it sends the 
#request to index.php 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 
    ErrorDocument 404 /index.php 
</IfModule> 

ответ

1

Поместите это в IIRF.ini:

RewriteEngine On 
RewriteBase 

#Removes access to the system folder by users. 
#Additionally this will allow you to create a System.php controller, 
#previously this would not have been possible. 
#'system' can be replaced if you have renamed your system folder. 
RewriteCond %{REQUEST_URI} ^mvc/core_business.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

#When your application folder isn't in the system folder 
#This snippet prevents user access to the application folder 
#Submitted by: Fabdrol 
#Rename 'application' to your applications folder name. 
RewriteCond %{REQUEST_URI} ^mvc.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

#Checks to see if the user is attempting to access a valid file, 
#such as an image or css document, if this isn't true it sends the 
#request to index.php 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 
+0

Спасибо, вы решили его – ahmedsaber111

+0

у меня есть еще один вопрос, что когда перейдите на другую страницу, иначе на главной странице будет отображаться страница ошибки 404 при удалении этой строки 'RewriteCond% {REQUEST_URI}^mvc/core_business. *' она отображает страницу, но без чтения css или изображений – ahmedsaber111

0

IIS не поддерживает .htaccess файлы - то есть Apache особенность.

У вас есть, чтобы установить IIRF, чтобы вообще переписывать, но все равно это будет не совсем то же самое.

IIRF Смотрите сайт для получения дополнительной информации, или рассмотреть возможность использования Apache для Windows;)