-11

How can write a clean url from http://domain.com/details.php?users=53#People to http://domain.com/53#people/ work out i need help fellows

  • This question can be easily answered with a quick search, both in Google and here. Also, the "clean" url you posted as example, isn't a valid url. – STT LCU Oct 02 '13 at 09:08
  • Hey i have tried out already, i just cant what i want, if you know the answer please just tell me instead of referring me to the huge Google – Mukiibi Ismail Oct 02 '13 at 09:16

1 Answers1

3

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'));
crafter
  • 6,246
  • 1
  • 34
  • 46