1

Example :

I go in the browser at :

www.example.com/documents/pages/doc.php?bacon=baked&this=tastes_good

And I would like that this link access to this page with the path encoded into the query :

www.example.com/index.php?url=documents%2Fpages%2Fdoc.php%3Fbacon%3Dbaked%26this%3Dtastes_good

The thing is that this index.php will need to take the big "url" query variable to decode and modify it in PHP and then fopen() the wanted page from an other site.
I need to do all that because the two sites need to use the same $_SESSION, databases and files and it would be harder to completely separate.

4

1 回答 1

1

假设你.htaccess在你的网络根/目录中有你的

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/index\.php [NC]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)$ index.php?url=$1%3F%1 [B,NE,L]

如果您仍然发现那些s没有被编码为.httpd.conf/%2F

于 2013-08-09T20:06:03.990 回答