prettyurl i cannot print the value

I am trying to work with pretty url’s. but I don’t know how to grab the value. I never tried to use pretty url in my projects. I hope you can help me. I am new with this pretty url.


RewriteEngine on

RewriteRule ^([0-9]+)/$ test.php?id=$1

# not a file
RewriteCond %{REQUEST_FILENAME} !-f
# not a directory
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .? /404.php [L]

in my test.php

here is the only code inside in my test.php

    $id = $_GET['id'];
    echo $id;

but it’s not printing.

I point my browser like this


structure of my project

   - index.php
   - .htaccess
   - test.php

Thank you in advance.

Source: .htaccess

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.