| | #1 |
| Warrior Join Date: 2011 Location: Suffolk, UK
Posts: 18
Thanks: 3
Thanked 2 Times in 2 Posts
|
Hi Guys, Does anyone know how I can change a url from this: example.com/?id=example1 to: example.com/example1 when using a GET variable, ie. taking out "?id=" in the url and showing just the value? I have seen other people using this but I have no idea how to use it myself, Thanks in advance |
| | |
| |
| | #2 |
| Active Warrior Join Date: 2011 Location: Winnipeg, Manitoba
Posts: 36
Thanks: 1
Thanked 6 Times in 6 Posts
|
They use HTACCESS to get the variable in the URL and silently send you to the PHP page, with that variable in the URL. User goes to example.com/example HTACCESS takes the example variable and puts it into a GET variable like example.com/?id=example HTACCESS silently redirects the page to the PHP script |
| |
| | #3 |
| Warrior Join Date: 2011 Location: Suffolk, UK
Posts: 18
Thanks: 3
Thanked 2 Times in 2 Posts
|
ok, i'll look into it, thanks for your reply
|
| | |
| |
| | #4 |
| Active Warrior Join Date: 2011
Posts: 87
Thanks: 16
Thanked 10 Times in 9 Posts
|
It called mod rewrite. You put rules into your .htaccess file and Apache will "rewrite" the pretty url to the correct url.
|
|
Need a QR Code? Check out my QR Code Generator. It's FREE!
| |
| |
| | #5 |
| HyperActive Warrior War Room Member Join Date: 2009
Posts: 145
Thanks: 3
Thanked 48 Times in 24 Posts
|
.htaccess is the way to go. You could also look into using an mvc framework like CodeIgniter, CakePHP or Recess. |
| | |
| |
|
| Bookmarks |
| Tags |
| hiding, php, showing, type, variable |
| |