dthp96899
2013-11-18 22:33 阅读 69
已采纳

apache url在根目录下重写连接重置

in my apache sites-available/default file i had change the config to folowing:

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All             //originally was AllowOverride None
    FallbackResource rewrite.php  //i added this line, too
    Order allow,deny
    allow from all
</Directory>

i wanted to handle all url calls in my own rewrite.php file. this works, when i visit my site at http://192.168.1.104:4567/web/knxzkcha but doesnt work when i go for http://192.168.1.104:4567/web/. i got this problem in firefox : The connection to the server was reset while the page was loading.

the index site http://192.168.1.104:4567/web/index.php works flawlessly and shows me my index.php file. all i want is to let me show the index file when visiting the root directory, too. /var/www points to the /web directory. i have some ubuntu 12.04 server 64 LTS edition

when i rewert the config lines, the root gives me the index file by default.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dtkwt62022 dtkwt62022 2013-11-19 09:41

    You do not need to add AllowOverride All, telling apache to avoid IO by checking existence of .htaccess files in current directory and all parents directories with AllowOverride None is a good recipe for speed. Avoid .htaccess files if you can edit Apache configuration.

    Now FallbackResource is a quite new feature and may have some bugs. Did you check the ErrorLog for details? Could you try that with LogLevel debug?

    It seems you problems is with directories, maybe you could fix it by enforcing usage of your fallback when a Directory is requested, try to add:

    DirectoryIndex  rewrite.php
    
    点赞 评论 复制链接分享

相关推荐