CodeIgniter - One.com托管服务上的Mod_Rewrite

时间:2014-05-05 19:49:51

标签: php .htaccess codeigniter mod-rewrite

我真的开始后悔在One.com购买域名

我有一个简单的CI项目设置,完全适用于localhost,但one.com不是我的朋友。我似乎无法让mod_rewrite工作。我甚至不打扰联系支持,因为我觉得任何需要索引页面以外的人都不欢迎。

这是我的.htaccess文件

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

#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} ^system.*
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
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|img|js|UberGallery|robots\.txt|css)
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>

在CI配置中:

$config['base_url'] = '';//I have tried the full URI.
$config['index_page'] = ''; 
$config['uri_protocol'] = 'AUTO'; //I have tried REQUEST_URI as well.

luc是我域的子域名,因此是.htaccess中的RewriteBase。 在我的所有子文件夹中,我有一个.htaccess文件,拒绝所有人。 这似乎是one.com特定的问题,所以我希望有人经验丰富,可以在我的设置中发现错误。

我做错了什么?

0 个答案:

没有答案