开发者

htaccess rewrite

开发者 https://www.devze.com 2022-12-08 23:15 出处:网络
I am working on a project and it utilizes a shortened url for redirection, I\'ve gotten th开发者_开发问答e following code to work perfectly:

I am working on a project and it utilizes a shortened url for redirection, I've gotten th开发者_开发问答e following code to work perfectly:

XBitHack      Off
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f  

RewriteCond   %{REQUEST_URI} \/([0-9A-Za-z]{4})$ [NC]
RewriteRule   ^(.*) ./getdeck.php?deck=%1 [L]

Now I want to add a second redirect rule for /a/([0-9A-Za-z]{4} but no matter how I write it, the new rule fails. Can anyone help explain what I'm missing?

Examples I have tried:

RewriteCond   %{REQUEST_URI} ^/a/.*$ [NC]
RewriteRule   ^(.*) ./deck/makedeck.php?deck=%1 [L]

or

RewriteCond   %{REQUEST_URI} ^/a/([0-9A-Za-z]{4})$ [NC]
RewriteRule   ^(.*) ./deck/makedeck.php?deck=%1 [L]


You might have to repeat the first two conditions.

0

精彩评论

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