douju1997 2018-07-24 14:54
浏览 24

Linux到Windows的htaccess规则

i have following .htaccess rules which are basically defined for Linux environment, but i want to use them on my Xampp localhost on windows. Cant figure out on how to change them so it can work with windows too, or it should be so that local environment works and live works too.

# Ensure www is in front of domain
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Force HTTPS
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

if use the same rules i get object not Found 404, dont know how to make it work on my xampp local.

EDIT Access Logs

::1 - - [24/Jul/2018:19:50:57 +0500] "GET /rds-core/ HTTP/1.1" 404 1054 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0"
::1 - - [24/Jul/2018:20:22:36 +0500] "GET /rds-core/ HTTP/1.1" 404 1054 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0"
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器