Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 请问一下htaccess正则匹配的问题

请问一下htaccess正则匹配的问题

Jun 23, 2016 pm 01:51 PM
htaccess match regular

请问一下, 类似如下的地址
http://localhost/info.html\"
打算过滤掉多输入的\"

RewriteRule ^info.html(.*)$ member_info.php
RewriteRule ^info.html\\\"$ member_info.php

都匹配失败了, 请问一下, 有其他的匹配方法么?


回复讨论(解决方案)

又不影响使用,何必让 Apache 那么辛苦?
再说,重写不会改变地址栏的显示,跳转才会

http://bbs.csdn.net/topics/390859703
http://bbs.csdn.net/topics/390859703/

这个/放在上面也没啥,效果是同样的。

又不影响使用,何必让 Apache 那么辛苦?
再说,重写不会改变地址栏的显示,跳转才会



http://bbs.csdn.net/topics/390859703/“ 改成http://bbs.csdn.net/topics/390859703
前者是显示失败404
我想转成后者才是正常的。

http://bbs.csdn.net/topics/390859703
http://bbs.csdn.net/topics/390859703/

这个/放在上面也没啥,效果是同样的。


还有一个引号的。 
http://bbs.csdn.net/topics/390859703/“ 改成http://bbs.csdn.net/topics/390859703
前者是显示失败404
我想转成后者才是正常的。

如果加了,遇到真正文件?就出?了。

如果加了,遇到真正文件?就出?了。



目前没有真正文件夹。 始终匹配不到。 


http://bbs.csdn.net/topics/390859703
http://bbs.csdn.net/topics/390859703/

这个/放在上面也没啥,效果是同样的。


还有一个引号的。 
http://bbs.csdn.net/topics/390859703/“ 改成http://bbs.csdn.net/topics/390859703
前者是显示失败404
我想转成后者才是正常的。
你在什么浏览器测试,我这边效果是一样。

http://localhost/info.html\"
打算过滤掉多输入的\"

RewriteRule ^info.html(.*)$ member_info.php

已经搞定了, 这个可以匹配的到。

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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

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)

Practical Guide to Regular Expressions in Go: How to Match Hexadecimal Color Codes Practical Guide to Regular Expressions in Go: How to Match Hexadecimal Color Codes Jul 13, 2023 am 10:46 AM

Go Language Regular Expressions Practical Guide: How to Match Hexadecimal Color Codes Introduction: Regular expressions are a powerful and flexible tool for pattern matching and finding strings. In Go language, we can use the built-in regular expression package regexp to implement these operations. This article will introduce how to use regular expressions to match hexadecimal color codes in Go language. Importing the regular expression package First, we need to import the regular expression package regexp of the Go language. You can add the following import statement at the beginning of the code: i

How to replace a string starting with something with php regular expression How to replace a string starting with something with php regular expression Mar 24, 2023 pm 02:57 PM

PHP regular expressions are a powerful tool for text processing and conversion. It can effectively manage text information by parsing text content and replacing or intercepting it according to specific patterns. Among them, a common application of regular expressions is to replace strings starting with specific characters. We will explain this as follows

PHP regular expression in action: matching letters and numbers PHP regular expression in action: matching letters and numbers Jun 22, 2023 pm 04:49 PM

PHP regular expression practice: matching letters and numbers Regular expression is a tool used to match strings, which can easily realize string search, replacement, split and other operations. Regular expressions are also a very useful tool in PHP development. This article will introduce how to use PHP regular expressions to match letters and numbers. Matching a Single Character To match a single character, you can use the character classes in regular expressions. Character classes are represented by square brackets []. The characters in them represent the characters that can be matched. You can use hyphens - to represent ranges.

How to match multiple words or strings using Golang regular expression? How to match multiple words or strings using Golang regular expression? May 31, 2024 am 10:32 AM

Golang regular expressions use the pipe character | to match multiple words or strings, separating each option as a logical OR expression. For example: matches "fox" or "dog": fox|dog matches "quick", "brown" or "lazy": (quick|brown|lazy) matches "Go", "Python" or "Java": Go|Python |Java matches words or 4-digit zip codes: ([a-zA

PHP regular expressions: exact matching and exclusion of fuzzy inclusions PHP regular expressions: exact matching and exclusion of fuzzy inclusions Feb 28, 2024 pm 01:03 PM

PHP Regular Expressions: Exact Matching and Exclusion Fuzzy inclusion regular expressions are a powerful text matching tool that can help programmers perform efficient search, replacement and filtering when processing text. In PHP, regular expressions are also widely used in string processing and data matching. This article will focus on how to perform exact matching and exclude fuzzy inclusion operations in PHP, and will illustrate it with specific code examples. Exact match Exact match means matching only strings that meet the exact condition, not any variations or extra words.

PHP String Matching Tips: Avoid Ambiguous Included Expressions PHP String Matching Tips: Avoid Ambiguous Included Expressions Feb 29, 2024 am 08:06 AM

PHP String Matching Tips: Avoid Ambiguous Included Expressions In PHP development, string matching is a common task, usually used to find specific text content or to verify the format of input. However, sometimes we need to avoid using ambiguous inclusion expressions to ensure match accuracy. This article will introduce some techniques to avoid ambiguous inclusion expressions when doing string matching in PHP, and provide specific code examples. Use preg_match() function for exact matching In PHP, you can use preg_mat

How to use regular expressions to remove Chinese characters in php How to use regular expressions to remove Chinese characters in php Mar 03, 2023 am 10:12 AM

How to remove Chinese in PHP using regular expressions: 1. Create a PHP sample file; 2. Define a string containing Chinese and English; 3. Use "preg_replace('/([\x80-\xff]*)/i', '',$a);" The regular method can remove Chinese characters from the query results.

How to use regular matching to remove html tags in php How to use regular matching to remove html tags in php Mar 21, 2023 pm 05:17 PM

In this article, we will learn how to remove HTML tags and extract plain text content from HTML strings using PHP regular expressions. To demonstrate how to remove HTML tags, let's first define a string containing HTML tags.

See all articles