开发者

I want to rewrite url through .htaccess rule?

开发者 https://www.devze.com 2023-02-28 23:13 出处:网络
Hi guys actually my url is \"http://collection.com/alok/ranjan/dubey.php?pid=12\" i want to remove two folder in between this url and my output will be \"http://collection.com/dubey.php?pid=12\" pleas

Hi guys actually my url is "http://collection.com/alok/ranjan/dubey.php?pid=12" i want to remove two folder in between this url and my output will be "http://collection.com/dubey.php?pid=12" please help me. i am writing as shown belo开发者_如何学JAVAw

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^dubey.php?pid=([a-zA-Z0-9\-]+)$ alok/ranjan/dubey.php?pid=$1


I believe that there is a problem in the regex... it should be

^dubey.php?pid=([a-zA-Z0-9\-]+)$ alok/ranjan/dubey.php?pid=$1

you forgot to escape the '-' sign which is a special char in regex.


i am using this website for rewriting

http://webtools.live2support.com/misc_rewrite.php


shortest version:)

RewriteRule ^dubey.php?pid=([0-9]+)$ alok/rajan/dubey.php?pid=$1
0

精彩评论

暂无评论...
验证码 换一张
取 消