Need help with URL REWRITE

Hello All,

I can do very very basic rewrites but I am struggling with how to implement a rewrite rule like the following:

https://packet3.co.uk/[PATH]?[PARAMS]
needs to be interpreted as such:

https://packet3.co.uk/index.php?i=[PATH]&[PARAMS] [PATH]
will be a string containing any kind of character except
?, =, & or #. [PARAMS]
will be a string of standard URL-encoded query parameters Examples:
https://packet3.co.uk/site/home -> https://packet3.co.uk/index.php?i=site/home
https://packet3.co.uk/user/view?id=123 -> https://packet3.co.uk/index.php?i=user/view&id=123

I will be grateful for any help and assistance.

Joe

# Rewrite only if the request isn't for a real file, such as index.php
RewriteCond %{REQUEST_FILENAME} !-f

# Rewrite everything to index.php, passing the original path as a query,
# and also retaining the original query string (QSA).
RewriteRule ^(.*)$ index.php?i=$1 [QSA]
1 Like

Many thanks Jeff_Mott for your time and help :smile:
Joe

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.