-1

Simple question (I hope). I have a need to remove the query from the url and rewrite it keeping only the string.

Example:

http://example.com/photography/?c=events

And the end result should be:

http://example.com/photography/events
Rik
  • 1
  • 1
  • 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) – Croises Nov 16 '16 at 01:09

1 Answers1

0

What about:

RewriteEngine on

# capture the value of c parameter of the query string (as %1)
RewriteCond %{QUERY_STRING} (?:^|&)c=([^&]+)
RewriteRule ^photography/$ $0%1? [L]

?

julp
  • 3,860
  • 1
  • 22
  • 21