logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: help with rewrite rules
Author
tdkappa



Joined: 15 Feb 2017
Posts: 8

PostPosted: Mon 06 Mar '17 20:21    Post subject: help with rewrite rules Reply with quote

Hello to everyone:

I have this question:

RewriteRule ^mydirectory/user/([0-9]+)/([a-zA-Z0-9-]+)/$ mydirectory/?u=$1&action=20

and

http://localhost/mydirectory/user/1/tdkappa/ it's like

http://localhost/mydirectory/?u=$1&action=20

it works (I have $_GET['u'] = "1" and $_GET['action'] = "20")


how can I modify the rewrite rule resolve this:

http://localhost/mydirectory/user/1/tdkappa/?a=1&b=2&c3

with this:

http://localhost/mydirectory/?u=$1&action=20&a=1&b=2&c3

Thank You for Everything !
Back to top
mraddi



Joined: 27 Jun 2016
Posts: 149
Location: Schömberg, Baden-Württemberg, Germany

PostPosted: Wed 15 Mar '17 1:27    Post subject: Reply with quote

googled and found this (among other results): http://stackoverflow.com/questions/1546535/apache-rewrite-rule-with-parameters

This leads me to this
Code:
RewriteRule ^mydirectory/user/([0-9]+)/([a-zA-Z0-9]+)/ mydirectory/index.php?u=$1&action=20&%{QUERY_STRING} [NC,L]


Hope this helps?
Back to top


Reply to topic   Topic: help with rewrite rules View previous topic :: View next topic
Post new topic   Forum Index -> Apache