-4

I have a page

root/pages/?id=webdesign

and I want to translate it into something like

root/pages/webdesign
Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198
jil harrys
  • 11
  • 2
  • Do you mean just for requests for root/pages or for your entire site or something? – S. Imp Jan 07 '17 at 18:40
  • 4
    Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – chris85 Jan 07 '17 at 18:43
  • I want to remove the value of the id from the URL (remove ?id= from URL) – jil harrys Jan 07 '17 at 18:43
  • You have a history of poorly received questions, and if you have not hit the question ban already, you will do very shortly. If you want the privilege of asking new questions here, please read the Help Centre _before_ posting again. – halfer May 11 '17 at 23:55

1 Answers1

1

To keep the prefix and replace the last part with a query string

RewriteCond %{QUERY_STRING} !^id=
RewriteRule ^root/pages/(.+)$ /root/pages/?id=$1 [L]

The RewriteCond is needed to prevent a rewrite loop.

Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198