Home Backend Development PHP Tutorial 求把不带www域名跳到带www域名下的ISAPI Rewrite写法

求把不带www域名跳到带www域名下的ISAPI Rewrite写法

Jun 13, 2016 pm 01:24 PM
abc com http

求把不带www域名跳到带www域名上的ISAPI Rewrite写法
我要把http://abc.com/zb/ 跳到http://www.abc.com/zb/上

注意域名后的路径也要带上哦

RewriteCond Host: ^abc\.com(.*)
RewriteRule (.*) http\://www\.abc\.com$1 [I,RP]

我这样写有哪地方不对啊?

------解决方案--------------------

探讨

RewriteEngine on
RewriteCond %{http_host} ^abc.com [NC]
RewriteRule ^(.*)$ http://www.abc.com/$1 [L,R=301]

------解决方案--------------------
探讨

引用:

和目不目录没关系吧
例:

RewriteCond %{HTTP_HOST} ^162100.com [NC]
RewriteRule ^(.*)$ http://www.162100.com/$1 [L,R=301]

你这方法不对
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What does http status code 520 mean? What does http status code 520 mean? Oct 13, 2023 pm 03:11 PM

What does http status code 520 mean?

Hongmeng native application random poetry Hongmeng native application random poetry Feb 19, 2024 pm 01:36 PM

Hongmeng native application random poetry

How to use Nginx Proxy Manager to implement automatic jump from HTTP to HTTPS How to use Nginx Proxy Manager to implement automatic jump from HTTP to HTTPS Sep 26, 2023 am 11:19 AM

How to use Nginx Proxy Manager to implement automatic jump from HTTP to HTTPS

Understand common application scenarios of web page redirection and understand the HTTP 301 status code Understand common application scenarios of web page redirection and understand the HTTP 301 status code Feb 18, 2024 pm 08:41 PM

Understand common application scenarios of web page redirection and understand the HTTP 301 status code

What is http status code 403? What is http status code 403? Oct 07, 2023 pm 02:04 PM

What is http status code 403?

http request 415 error solution http request 415 error solution Nov 14, 2023 am 10:49 AM

http request 415 error solution

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files Sep 12, 2023 pm 01:15 PM

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files

Common network communication and security problems and solutions in C# Common network communication and security problems and solutions in C# Oct 09, 2023 pm 09:21 PM

Common network communication and security problems and solutions in C#

See all articles