dthp96899 2013-11-18 22:33
浏览 70
已采纳

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

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题