dqr3883 2015-01-06 09:22
浏览 142
已采纳

.htaccess:RewriteBase接受一个参数,即每个目录上下文的基本URL

I am getting Internal server error due to .htaccess.

My code is below

RewriteEngine on

RewriteBase /

# Prevent CI index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 

# Prevent user access to the CI system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L] 

# Prevent user access to the CI application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

and error_log file show]

/home/adonwayc/public_html/billing/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context
[Tue Jan 06 14:43:58.213270 2015] [core:alert] [pid 642720] [client 122.177.194.19:60610] /home/adonwayc/public_html/billing/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context
[Tue Jan 06 14:39:28.780669 2015] [core:alert] [pid 583314] [client 122.177.194.19:57750] /home/adonwayc/public_html/billing/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context
[Tue Jan 06 14:39:28.780603 2015] [core:alert] [pid 583314] [client 122.177.194.19:57750] /home/adonwayc/public_html/billing/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context
  • 写回答

1条回答 默认 最新

  • dt3358 2015-01-06 12:14
    关注

    /home/adonwayc/public_html/billing/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context

    Looking at the logs, your htaccess seems to be located in billing subfolder.
    Your RewriteBase should then be /billing/.

    Also, REQUEST_URI begins with a leading slash /.
    Here is a corrected version of your htaccess

    RewriteEngine on
    RewriteBase /billing/
    
    RewriteCond %{REQUEST_URI} ^/(?:system|application) [NC]
    RewriteRule ^(.*)$ index.php?/$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L] 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改