0

so I have a few different links on my website, and I am looking for some advice on how I can achieve this.

Some example links:

domain/index.php?page=commandCenter&ID=40
domain/index.php?page=view&action=edit&ID=40
domain/index.php?page=acpDashboard

I would like the rewrite to look like the following for each link:

domain/commandCenter/40
domain/view/edit/40
domain/acpDashboard

Though it seems in order for this to work, I need to have something in place for those variables.

The last link would not work, but

domain/acpDashboard/0/0

is what it needs to work.

Is this possible, and how would I go about it? I only have 3 different variables page, action, and ID.

Here is my htaccess atm!

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.php$ /index.php?    page=$1&action=$2&ID=$3 [L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

Thanks for any advice!

Austin Willey
  • 39
  • 1
  • 3

1 Answers1

0

Your here is wrong you can reference .htaccess RewriteRule to preserve GET URL parameters this answer

RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.php$ /index.php?page=$1&action=$2&ID=$3 [L] 
Community
  • 1
  • 1
IamIdiot
  • 41
  • 8