Welcome! Log In Create A New Profile

Advanced

Re: rewrite help for w2box

May 14, 2009 07:14AM
On Thu, May 14, 2009 at 06:38:48AM -0400, lblasc wrote:

> No luck with rewrite for w2box. Can I get some help with this ?
>
> apache .htaccess :
>
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{QUERY_STRING} ^$
> RewriteRule ^(.*)$ index.php?d=$1&BAD_HOSTING=%{HTTP:Authorization}
>
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{QUERY_STRING} ^(.+)$
> RewriteRule ^(.*)$ index.php?%1&d=$1&BAD_HOSTING=%{HTTP:Authorization}
>
> RewriteCond %{QUERY_STRING} ^(.*)$
> RewriteRule (.+).php $1.php?%1&BAD_HOSTING=%{HTTP:Authorization}

It's a sealed book to me why w2box developers moved this query string
logic from PHP reach scripting to ugly RewriteRules.

If you use fastcgi, you may try:

server {

....

if ($args) {
set $args $args&;
}

location / {
try_files $uri $uri/ /index.php?${args}d=$uri;
}

location ~ \.php$ {
try_files $uri $uri/ /index.php?${args}d=$uri;

fastcgi_pass ...;
fastcgi_param QUERY_STRING ${args}&BAD_HOSTING=$http_authorization;
...
}

location = /index.php {
fastcgi_pass ...;
fastcgi_param QUERY_STRING ${args}&BAD_HOSTING=$http_authorization;
...
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

rewrite help for w2box

lblasc May 14, 2009 06:38AM

Re: rewrite help for w2box

Igor Sysoev May 14, 2009 07:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 52
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready