Below is a simple case that you are showing. You will need to add additional logic if you need to allow other parameters in the query string or file names before ?.
RewriteEngine On
RewriteCond %{QUERY_STRING} ^i=(.*)
RewriteRule ^.* /#Video:%1? [NE,R=permanent]
Why is it difficult?
- RewriteRule does not look at the query string, so you need to use RewriteCond to evaluate the QUERY_STRING variable and capture the part that you will need later (link through% 1)
- the hash symbol (#) is usually escaped, you must specify the [NE] flag
- The end? per lookup string is required to suppress the original query string
I tested this on Apache 2.2.
source
share