【问题标题】:codeigniter htaccess file in subdomain子域中的codeigniter htaccess文件
【发布时间】:2017-07-05 00:56:23
【问题描述】:

我在 codeigniter 中做了一个项目。 它在本地主机中运行完美。 localhost中的htaccess文件:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

然后我将项目删除到托管子域 College.utest.kz 但它在互联网上不起作用。将 htaccess 文件内容更改为 codeigniter 文档中的内容。结果是一样的 感谢阅读

【问题讨论】:

  • 你可以使用哪个服务器,比如linux,window等
  • @ChauhanShailesh linux

标签: .htaccess codeigniter mod-rewrite nginx


【解决方案1】:

试试

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

【讨论】:

  • 在浏览器中显示未找到页面。在日志文件中写着:[error] 32412#0: *4993796 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 185.97.115.34, server: college.utest.kz, request: "GET /college.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/college.utest.kz.sock:", host: "college.utest.kz"
  • 你能给我直播网址吗?如果可能的话
【解决方案2】:
RewriteEngine on

 RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots  \.txt|favicon\.ico)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

【讨论】:

  • 谢谢。但它没有帮助
【解决方案3】:
RewriteEngine On
RewriteBase /subdomain_name
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

使用您的子域文件夹名称重写基数

【讨论】:

    猜你喜欢
    • 2014-03-08
    • 2012-03-25
    • 2020-05-26
    • 1970-01-01
    • 2013-07-02
    • 1970-01-01
    • 2015-03-25
    • 1970-01-01
    • 2018-08-07
    相关资源
    最近更新 更多