Welcome to   
"The Blog"

Monday, May 19, 2008

Posted in Misc

PHP Friendly URL'S

You know, I had high hopes going into this but I should definitely know better.  Nothing is as easy as you think it is, especially when you’re learning it.

I took a look at my traffic results with analytics and I found that I was getting traffic on some long ass term that had the phrase php in it.  This is not bad at all, but when I took php out of the term, I was no where to be found.  That’s where the problem was.

So I started looking into search engine friendly URL’s for my PHP application because they were displaying like “…./blog.php?id=34”.  Not very helpful if you wanted to know what the page was about.

So now comes the research!

I started to look into mod rewrite with the .htaccess file.  I looked into what I could do and tried it out.  One thing to look out for folks:          

There are a million different tutorials that tell you nothing!

I should re-phrase that.  It’s not that they don’t tell you anything.  It’s just that, EVERYTHING THEY TELL YOU DOESN’T WORK!!!

I copy and pasted a million different types of tutorials that told me to do this that and the third and I only got it working when I spent 8 hours looking into it, deciphering every code that was offered,  and figuring out how to do this crap on my own.  Thanks Internet!

I find that every time I need a fast solution, I never get one! Maybe it’s me.  Anyway, I finally got the stuff to work…yeah right!

You see I thought I got it to work but here’s what happened.

…/blog.php?id=34 turned into …/blog34/PHP/TITLEOFTHEBLOG.htm

Awesome right, NO!, because now, not only did "…/blog34/php/titleofblog.htm" work, but so did "…/blog34/NONSENSE/TYPEANYCRAPYOUWANTHERE".  And that is not a good thing.

On top of that, I couldn’t get the old paths to redirect to the new ones. So now I’m stuck.  I’m still trying to figure out how to redirect the old paths and trying to get the new “Friendly URL’s” to work as a unique address.

You would think forums would help, but everyone’s an a**hole and no one wants to respond to my thread. 

Once again, Thanks Internet!

 

Note: I may have found a solution but only time will tell.  This is what I’ll be working on from the time being along with some client stuff so if you don’t hear from me for a while, now you know why.

UPDATE: I found the solution, finally. Friendly URL Tutorial 01


 

What do you think of "PHP Friendly URL'S"?

There are currently (3) comments.


Enter Your Nickname

Enter A Comment

What is two plus two?

 

Comments:

August
5
Tuesday

Awesome! Thank you, as soon as I get time, I'm definitely going to try that out! There's a bunch of updates I need to do, that is one of many, thanks though!

Posted by Jonathan at 9:18 am

August
4
Monday

Hey Jonathan,

Don't rewrite in your .htaccess like many of the tutorials teach. Instead, use a handler file, which will handle all incoming requests. Your .htaccess simply performs the redirect. This might help you get started. http://tinyurl.com/5ckxsp

This is much easier to do in PHP because you will not be able to do redirects and URL rewrites without accessing the database at some point... which cannot happen in the .htaccess file.

Brian

Posted by Brian at 2:30 pm

May
20
Tuesday

Once you find out, let us know because that's something that has me stuck too.

Posted by Robert at 4:02 pm

Blog Categories

Misc (3)

Personal (3)

Design (2)

Internet Marketing (6)

PHP (3)


Latest Blogs

» Why do I need a website
» Site Updates and Stuff
» Google Chrome Browser
» I'm Moving!
» A Designers Nightmare

Some websites I've done...

SureFire Web Services Baby Tutors Ester-C Karma Bars
ZoAir ATS JS American Container Concepts