. Htaccessurl contains special characters

Source: Internet
Author: User
. Htaccessurl contains special characters. RewriteRule ^ (r | R) (e | E) (g | G) step2 (.*)? $ Do. php? Ac6a538ae003e30eacbd5b0c1f1d18aa50 & amp; opactive & amp; hash $4 I will define the above rules in the. htacess file. I hope 127.0.0.1reg. htaccess url contains special characters.
RewriteRule ^ (r | R) (e | E) (g | G)/step2 /(.*)/? $ Do. php? Ac = 6a538ae003e30eacbd5b0c1f1d18aa50 & op = active & hash = $4
Define the above rules in the. htacess file.
Http: // 127.0.0.1/reg/step2/versions % 2FT189% 2BJz can be parsed
Http: // 127.0.0.1/do. php? Ac = 6a538ae003e30eacbd5b0c1f1d18aa50 & op = active & hash = signature % 2FT189% 2BJz

It seems that there is a problem during running. the hash parameter contains special characters and cannot be correctly parsed. the prompt "Object not found" is displayed!
If you directly enter http: // 127.0.0.1/reg/step2/tests/T189 + Jz (I .e., special symbols such as // and + do not pass through urlencode), you can resolve the issue, parameters in hash cannot be restored to original parameters. (Two values in the hash parameter are encrypted and transmitted through a custom function. you can call the decoder function to restore the two values)


------ Solution --------------------
Urlencode ()

Urldecode () after receiving the data and then call your decryption function
------ Solution --------------------
^ (R | R) (e | E) (g | G)/Why. Direct [NC]
------ Solution --------------------
If you cannot
$ Url = 'XXX ';
$ Url = urlencode (str_replace ('/','! ', $ Url ));
..........
When receiving data
$ Url = urldecode (str_replace ('! ','/', $ Url ));

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.