1

I am passing encrypted value through the URL using .htaccess file as shown below : URL :

http://www.website.com/folder1/f1/tdT9Eu%2b8kmAe1U%2ft12RS

htaccess file :

RewriteRule ^f1/(.+)$  index.php?id=$1 [NE]

The issue is the server respond by The requested URL was not found on this server. but when I replace %2f by / and %2b b s+ it works perfectly and I can see the content of the page.

it works also perfectly when I use the url without any rewriting as shown below :

http://www.website.com/folder1/index.php?id=tdT9Eu%2b8kmAe1U%2ft12RS

Could you please help with that and how can I modify my htaccess to make this work ? because I need to get the content using url rewriting as shown above

ayoub
  • 93
  • 1
  • 3
  • 15
  • Possible duplicate of [%2F in URL breaks and does not reference to the .php file required](http://stackoverflow.com/questions/9206835/2f-in-url-breaks-and-does-not-reference-to-the-php-file-required) – kenorb Jul 19 '16 at 10:22

2 Answers2

1

It is due to presence of %2f in URI that is usually not allowed by Apache web server by default. It is allowed in query string that's why ?id=... is working fine.

You will need to turn on AllowEncodedSlashes directive in Apache config for this.

Use:

AllowEncodedSlashes On

to allow encoded slash in URIs and restart your Apache web server.

anubhava
  • 761,203
  • 64
  • 569
  • 643
0

I think you'll find the answer you're looking for here: Htaccess RewriteRule to accept special characters

Basically, change it to RewriteRule ^f1/(^/.+)$ index.php?id=$1 [NE]

Community
  • 1
  • 1