[Solved] How can write a clean url in php? [duplicate]


What you are really asking is that the request to details.php gets routed to index.php.

You will therefore need some code in index.php to understand this request is for details.

You can use this in your .htaccess file

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1

In your index.php, you can extract the actual request and action it.

$request = substr($_SERVER['PHP_SELF'], strlen('/index.php'));

solved How can write a clean url in php? [duplicate]