php 如何在 Windows 服务器上使用 .htaccess 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23809418/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:58:34  来源:igfitidea点击:

How to use .htaccess file on windows server

phpapache.htaccess

提问by R. Baris Taskiran

I using GoDaddy products. I've one hosting and last week I changed linux to windows server. After I changed hosting type, unfortunatelly the 404 redirection doesn't working..

我使用 GoDaddy 产品。我有一个主机,上周我将 linux 更改为 Windows 服务器。更改托管类型后,不幸的是 404 重定向不起作用..

I've .htaccess file like this:

我有这样的 .htaccess 文件:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http//www.%{HTTP_HOST}/ [R=301,L]

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteRule ^(.*).html$                                       viewcontent.php?id=                            [NS]
RewriteRule ^(.*).htm$                                        haberler.php?id=                               [NS]
RewriteRule sitemap.xml                                       xml.php                                          [NS]

How I can use this links on windows hosting.. what I have to do?

我如何在 Windows 主机上使用此链接.. 我必须做什么?

Btw, I think GoDaddy windows hosting doesn't support apache. So I can't use .htaccess

顺便说一句,我认为 GoDaddy Windows 托管不支持 apache。所以我不能使用 .htaccess

Thanks for helps.

感谢您的帮助。