I have a PHP script that accepts a single parameter.
My project structure is like the following:
index.php
i.php
terms.php
functions
includes
icons
resources
The script that I want to rewrite its URL is i.php
from
example.com/i.php?icon=id
to
example.com/id
While making sure everything else is normally accessible (e.g. example.com/terms.php
).
How do I do that?
Edit This might be helpful. Here's my previous .htaccess that I used to use on my apache server:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(\w+)$ ./i.php?icon=$1