我的.htaccess文件在000webhost不工作 [英] My .htaccess file in 000webhost is not working

查看:224
本文介绍了我的.htaccess文件在000webhost不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经添加了我的项目免费托管000webhost和我的所有文件列在public_html /目录。
项目是在codeigniter中构建的。
i在public_html / .htaccess中添加了htaccess文件,其中包含

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

但这对我不起作用htaccess有什么问题吗?



 

我使用这个方法(在本地和远程都适用于我) DirectoryIndex index.php

RewriteEngine on
RewriteCond%{REQUEST_FILENAME}!-f
RewriteCond%{REQUEST_FILENAME}!-d
RewriteCond $ 1 !^(index\.php | public | images | css | js | robots\.txt)

RewriteRule ^(。*)$ index.php?/ $ 1 [L]

您需要在root rolder中创建一个名为public的文件夹,并为css,js等创建子文件夹。


i have added my project on free hosting 000webhost and my all files are listed in public_html/ directory. project is built in codeigniter. i have added htaccess file at public_html/.htaccess which contains

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

but this does not working for me is there any issue in htaccess?

解决方案

I use this (it works for me in both, locally and remotely):

DirectoryIndex index.php

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|css|js|robots\.txt)

RewriteRule ^(.*)$ index.php?/$1 [L]

You need to create a folder called "public" in the root rolder and sub-folders for css, js etc.

这篇关于我的.htaccess文件在000webhost不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆