.htaccess

Post here is you are having problems with any of the tutorials.
Post Reply
Nikitaa
Posts: 4
Joined: Thu Nov 10, 2011 11:28 am

.htaccess

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: .htaccess

Post by jacek »

In what way does it not work ?
Image
Nikitaa
Posts: 4
Joined: Thu Nov 10, 2011 11:28 am

Re: .htaccess

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: .htaccess

Post 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 ?
Image
Nikitaa
Posts: 4
Joined: Thu Nov 10, 2011 11:28 am

Re: .htaccess

Post by Nikitaa »

It Just says invalid key .

Htaccess worked in your lamp server from the start ?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: .htaccess

Post by jacek »

Well that sounds like it is working :?

Try doing
echo $_GET['key'];
and see what you get ?
Image
Nikitaa
Posts: 4
Joined: Thu Nov 10, 2011 11:28 am

Re: .htaccess

Post by Nikitaa »

It's Working , nevermind :x

Thabk you :)
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: .htaccess

Post by jacek »

Hurray !
Image
Post Reply