2016-06-10 17 views
1

Ich habe ein Problem beim Umschreiben der URL mit .htaccess.htaccess Rewrite URL mit 4 GET Parametern

es funktioniert gut mit 3 GET-Parameter.

test.com/account/activation/id123

<Files .htaccess> 
order allow,deny 
deny from all 
</Files> 

Options -Indexes 

RewriteEngine On 
RewriteBase/

RewriteRule ^account$ account.php [NC,L] 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^account/([^./]+)$ account.php?id=$1 [NC,L] 
RewriteRule ^account/([^./]+)/([^./]+)$ account.php?id=$1&activation=$2 [NC,L] 

bis ich versuche weitere Parameter hinzuzufügen.

RewriteRule ^account/([^./]+)/([^./]+)$ account.php?id=$1&activation=$2&re=$3 [NC,L] 

test.com/account/activation/id123/taken

es funktioniert nicht. Es geht auf 404 nicht gefunden Seite.

Was ist falsch an meinem Code?

Dank im Voraus ...

Antwort

1

Ihre RegexMuster 2 Muster noch akzeptiert. Sie können diese Regeln verwenden:

RewriteEngine On 
RewriteBase/

RewriteRule ^account/?$ account.php [NC,L] 

RewriteCond %{REQUEST_FILENAME} -d [OR] 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule^- [L] 

RewriteRule ^account/([^/]+)/?$ account.php?id=$1 [NC,L,QSA] 

RewriteRule ^account/([^/]+)/([^/]+)/?$ account.php?id=$1&activation=$2 [NC,L,QSA] 

RewriteRule ^account/([^/]+)/([^/]+)/([^/]+)/?$ account.php?id=$1&activation=$2&re=$3 [NC,L,QSA] 
+0

danke anubhava für die Beantwortung, aber es funktioniert immer noch nicht. es geht um 404 nicht gefunden. –

+0

Ist dies die vollständige URL, die 404 verursacht? Http: // test.com/account/activation/id123/taken? – anubhava

+0

yup, das ist richtig –