2013-06-12 154 views
0

我有我的codeigniter安装.htaccess文件的问题。 在本地主机上这工作很好,当我上传其重写网址,但网站无法正常工作。子域虚拟主机codeigniter htaccess文件

这是我在本地主机上的htaccess:

RewriteEngine On 
RewriteBase /jCore_01/ 
#RewriteBase/

### Canonicalize codeigniter URLs 

# If your default controller is something other than 
# "welcome" you should probably change this 
RewriteRule ^(welcome(/index)?|index(\.php)?)/?$/[L,R=301] 
RewriteRule ^(.*)/index/?$ $1 [L,R=301] 

# Removes trailing slashes (prevents SEO duplicate content issues) 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)/$ $1 [L,R=301] 



# Enforce NO www 
#RewriteCond %{HTTP_HOST} ^www [NC] 
#RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301] 



RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ /index.php/$1 [L] 

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

网上我有一个问题: 我把这个文件的子域jcore.miodomio.com并重写URL,但无法工作

例如: 没有htaccess的它的工作: jcore.miodominio.com/index.php/en/home

与htaccess的 jcore.miodominio.com/en/home

找不到

在此服务器上找不到请求的URL/en/home。

任何人都可以帮助我吗?建议? 问候

丹尼

回答

1

试着改变你的htaccess到:

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

+0

对不起,我不写我刚刚删除它 –

+0

在应用程序/ config/config.php第14行 $ config ['index_page'] =''; –

+0

不行:-(也从是否配置文件 –

0

出头的考虑。

  1. 您是否启用Apache重写模块?
  2. 如果启用检查您的虚拟主机文件配置是否正确因此,以确保其打击.htaccess或尝试将一些转储放在.htacess,所以如果它击中.htaccess比你应该得到500服务器错误。

如果您的主机设置中没有出现比主要问题更多的错误。