General Question

jrpowell's avatar

How do I get pretty URLs on my website?

Asked by jrpowell (40562points) November 7th, 2007

I would like to have Pretty URL’s on my website.

For example:
http://www.whatever.com/album.php?alph=A&artist=Alexisonfire would become
http://www.whatever.com/A/Alexisonfire

I have tried so many tutorials and can’t get this to work. I’m sure that this is done with .htaccess but I just cant get it to work. My host is http://www.nearlyfreespeech.net/

Any help would be fantastic.. Thanks..

Observing members: 0 Composing members: 0

4 Answers

cwilbur's avatar

It’s done (or can be done) with mod_rewrite, which may be configurable from .htaccess files, and the details are rather more complex than a fluther answer really allows. In part, it depends on how you want the URLs rewritten and how your website is set up, and mod_rewrite is extremely powerful but also extremely complex.

Your best bet is to find someone who knows Apache web server configuration, and be prepared to shell out $100 or so for his or her time. This sort of consulting may actually be something your web host provides upon request.

Failing that, google for mod_rewrite and read up on it, and good luck.

Mangus's avatar

Is the php code that is serving those pages custom, or are you using an “off the shelf” CMS, open-source or otherwise? Many CMS offerings have built-in or community-created solutions for friendly URLs…

jrpowell's avatar

Just thought I would stop in to let everyone know that I got it working in theory..

I’m able to pull through the needed variables. Still a bunch of things that need to be worked out. I will basically have to re-write my site to get everything working properly. But the code was really ugly and needs to be cleaned up anyway.

Here is what I got working.. http://prettyurltest.nfshost.com/

Thanks..

deathfrombelow's avatar

SInce, you have mod_rewrite working on you site, checkout http://www.workingwith.me.uk/articles/scripting/mod_rewrite, it is an excellent tutorial for learning mod_rewrite. Also checkout this link, it is a cheat sheet with all of the things that you will need to get a complex or simple rewrite rule set up and runnig.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther