ModRewrite needs to be enabled in apache2 by executing:
a2enmod rewrite
Modify your HTaccess File like this if index.php is your main php File:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?i=$1 [L,QSA]
For example, if the user enters the URL yourdomain.ending/wiki/testcategorie
you can fetch the url parameters like this in your PHP Script:
$location = explode("/", htmlspecialchars(@$_GET["i"]));
Location is now a array with the URL values inside it.
In our example
yourdomain.ending/wiki/testcategorie
The array would be like:
location[0] = wiki
location[1] = testcategorie
Now you can load your modules with a switch/case loop or do anything else what you need to do with that
URL informations.
I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
Comments
System - 2022-08-17 03:19:16
Thanks for visiting my page and have a nice day!