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] 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于vue2中methods使用call修改this指向的问题
  • ¥15 idea自动补全键位冲突
  • ¥15 请教一下写代码,代码好难
  • ¥15 iis10中如何阻止别人网站重定向到我的网站
  • ¥15 滑块验证码移动速度不一致问题
  • ¥15 定制ai直播实时换脸软件
  • ¥100 栈回溯相关,模块加载后KiExceptionDispatch无法正常回溯了
  • ¥15 Utunbu中vscode下cern root工作台中写的程序root的头文件无法包含
  • ¥15 麒麟V10桌面版SP1如何配置bonding
  • ¥15 Marscode IDE 如何预览新建的 HTML 文件