Welcome! Log In Create A New Profile

Advanced

banging head against the wall with rewrite

Posted by skogsmannen 
banging head against the wall with rewrite
March 10, 2013 01:43PM
On my test setup I succeeded with the setup but now I am banging my head against the wall with this.

The directory is /backoffice and the working .htaccess rules are.

===
Options -Multiviews

RewriteEngine On
RewriteBase /backoffice/
RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)//([-_a-zA-Z0-9]+)/$ dispatch.php?page=$1&action=$2&id=$3 [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ dispatch.php?page=$1&action=$2&id=$3 [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/$ dispatch.php?page=$1&action=$2 [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ dispatch.php?page=$1&action=$2 [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)/$ dispatch.php?page=$1&action= [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)$ /backoffice/$1/ [R]
RewriteRule ^$ dispatch.php [QSA] [L]
===

Example:
/backoffice/skapa/ /backoffice/skapa.php

/S
Re: banging head against the wall with rewrite
March 11, 2013 08:23AM
something like this is what I am looking for.

rewrite ^/backoffice/?(.*)$ /backoffice/dispatch.php?page=$1 last;
try_files $uri $uri/ /backoffice/dispatch.php?$args;
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready