Home > front end >  Brother, a.htaccess expression
Brother, a.htaccess expression

Time:10-02

RewriteRule ^ API/data/get? Sn=([a zA - Z0-9 \] *) $API/data/get PHP? Sn=$1
RewriteRule ^ API/data/post? Sn=([a zA - Z0-9 \] *) $API/data/post. PHP? Sn=$1
RewriteRule ^ API/data/unixtime? Sn=([a zA - Z0-9 \] *) $API/data/unixtime. PHP? Sn=$1

Has been debugging is not successful, is I made a mistake?

CodePudding user response:

You are what you doing now

CodePudding user response:

I want to visit www.xx/com/api/data/get? Sn=sn111, pseudo static real address is www.xx.com/api/data/get.php? Sn=sn111

CodePudding user response:

 RewriteRule ^ API/data/get? Sn=([a zA - Z0-9 \] *) $/API/data/get PHP? Sn=$1 

Have a try

CodePudding user response:

The
reference 3 floor A11085013 response:
 RewriteRule ^ API/data/get? Sn=([a zA - Z0-9 \] *) $/API/data/get PHP? Sn=$1 

Try


Seems like mine?

CodePudding user response:

 
RewriteEngine On
RewriteBase/
The RewriteCond % {QUERY_STRING}
(. *)RewriteRule ^ API/data/get $/API/data/get PHP

.htaccess Tester

CodePudding user response:

The
refer to the original poster tim8 response:
RewriteRule ^ API/data/get? Sn=([a zA - Z0-9 \] *) $API/data/get PHP? Sn=$1
RewriteRule ^ API/data/post? Sn=([a zA - Z0-9 \] *) $API/data/post. PHP? Sn=$1
RewriteRule ^ API/data/unixtime? Sn=([a zA - Z0-9 \] *) $API/data/unixtime. PHP? Sn=$1

Has been debugging is not successful, is I made a mistake?

If only to add a url address behind. PHP suffixes can use the following rules:
 RewriteEngine On 
RewriteBase/
The RewriteCond % {QUERY_STRING} sn=[/w] +
RewriteRule ^ (. *) $$1. PHP