繁体   English   中英

代码点火器项目中子文件夹中的htaccess不适用于实时服务器,但适用于本地主机

[英]htaccess in sub-folder in code-igniter project does not work for live server but works in localhost

我的网站有两个目录。

www.mydomain.com上的根目录和一个名为“ worker”的子文件夹,在我的网站中有两个htacess文件,一个是根目录:

wwww.www.mydomain.com:
 -htaccess
another is in 
wwww.www.mydomain.com/worker
 - htaccess

根目录htaccess的代码:

Options +FollowSymlinks
Options -Indexes
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Order deny,allow
 Deny from all
</FilesMatch>

RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

“工作者”子目录htaccess的代码:

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

我的根目录和“ worker”文件夹基于codeigniter ...最初,我不得不使用"localhost/index.php/worker"访问worker子文件夹。 当我使用重写从URL中删除index.php ,URI重读在localhost中工作,我可以使用"localhost/worker"在localhost中查看worker文件夹,但在实时服务器上, "wwww.mydomain.com/worker"我404错误"wwww.mydomain.com/worker"网址。

请有人解决它,以便我可以使用URL "wwww.mydomain.com/worker"在实时服务器中查看子文件夹。 注意:我的托管基于linux并运行Apache服务器。

问候zahid

您必须检查在线服务器上的权限,它应该是755 not 777因为在777上有时它不起作用..so,请检查htaccess文件的权限

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM