Page 1 of 1
.htaccess
Posted: Thu Nov 10, 2011 11:32 am
by Nikitaa
Hello
In your URL Shortener tutorial you demonstrate how to use .htaccess to make urls smaller but I can't get htaccess to work on lamp
Is there any command for that or something ?
Thank you
Re: .htaccess
Posted: Thu Nov 10, 2011 6:53 pm
by jacek
In what way does it not work ?
Re: .htaccess
Posted: Thu Nov 10, 2011 7:02 pm
by Nikitaa
It Doesn't shorten the uurl's and by the moment i create it the file becomes hidden and i have to crtl+h to see it
This is the code I have in the htaccess :
RewriteEngine On
RewriteRule ^([a-z0-9]+)$ go.php?key=$1
Re: .htaccess
Posted: Fri Nov 11, 2011 8:14 pm
by jacek
Nikitaa wrote:i create it the file becomes hidden and i have to crtl+h to see it
That is normal, the . at the start of the name means hidden to most OSs
Nikitaa wrote:It Doesn't shorten the uurl's
What does it do ? When you browse to
http://thing.com/key what do you get ?
Re: .htaccess
Posted: Fri Nov 11, 2011 9:07 pm
by Nikitaa
It Just says invalid key .
Htaccess worked in your lamp server from the start ?
Re: .htaccess
Posted: Sat Nov 12, 2011 12:41 pm
by jacek
Well that sounds like it is working
Try doing
echo $_GET['key'];
and see what you get ?
Re: .htaccess
Posted: Sun Nov 13, 2011 10:16 pm
by Nikitaa
It's Working , nevermind
Thabk you
Re: .htaccess
Posted: Mon Nov 14, 2011 10:21 pm
by jacek
Hurray !