我已将我的项目添加到免费托管 000webhost 上,我的所有文件都列在 public_html/ 目录中。
项目是在codeigniter中构建的。
我在 public_html/.htaccess 添加了 htaccess 文件,其中包含
Options +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]
您需要在根文件夹中创建一个名为“public”的文件夹,并为 css、js 等创建子文件夹。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)