How do I make a site with Search Engine friendly urls? Do I need special PHP code instead of:
$_GET['id']
How to access 'id' variable after rewriting URL?
How do I make a site with Search Engine friendly urls? Do I need special PHP code instead of:
$_GET['id']
How to access 'id' variable after rewriting URL?
In your example you just need below code in your .htaccess file, in main directory.
Options +FollowSymLinks
RewriteEngine on
RewriteRule /(.*) ?id=$1
Don't forget to create your links domain.com/123456
style. Web server will resolve domain.com/123456
correctly. For example:
<a href='domain.com/123456'>the link</a>
This is very basic question and there are millions of tutorials on internet. Just make some googling buddy.
Just add this to your htaccess file
Options +FollowSymLinks
RewriteEngine on
RewriteRule /(.*) ?id=$1 [QSA,NC,L]
note: if you already have
Options +FollowSymLinks
RewriteEngine On
on your htaccess file, just place
RewriteRule /(.*) ?id=$1 [QSA,NC,L]
under it and ignore the rest
instead of visiting domain.com/?id=123456, you now visit domain.com/123456/. then on that page you can still use $_GET['id'] the way you normally would