请验证htaccess代码 [英] Please Verify the htaccess code

查看:97
本文介绍了请验证htaccess代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的网址

I have a URL like this

http://www.freshupnow.com/movie.php?moviename=A+Flat


我想使用像这样的.htaccess代码重写此URL


I want to rewrite this URL using .htaccess code like this

http://www.freshupnow.com/movies/A+Flat


因此,我为此使用了以下代码


So, I have used the following code for this

RewriteRule ^movies/([A-Za-z0-9-]+)/?$ movie.php?moviename=$1 [NC,L]





Can Some one please verify it, Either it is Right or Wrong?

推荐答案

movie.php?moviename =
movie.php?moviename=


1 [ NC,L]
1 [NC,L]



有人可以验证一下,是对还是错?



Can Some one please verify it, Either it is Right or Wrong?


([[A-Za-z0-9-] +)应该是([A-Za-z0-9 \ +])+因为您想捕获整个组1次或多次,并且还希望在影片名称中允许使用"+"字符,例如示例"A + Flat".您可以使用以下在线工具自己验证正则表达式: Regex验证 [
([A-Za-z0-9-]+) should be ([A-Za-z0-9\+])+ coz you want to capture the whole group 1 or more times and you also want to allow "+" character in your movie names, as in the example "A+Flat". You can validate your regex yourself using this online tool: Regex Validate[^]. There are several others, try Googling for it.


这篇关于请验证htaccess代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆