Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 23318
  • Total topics 4048
  • Total members 5574
  • Our newest member
    ALF5583

TOP POSTERS

Setting up folders and files for URL cleanup

Server administration, server soft- and hardware.
   

Setting up folders and files for URL cleanup

Postby wbshim » Mon May 11, 2009 9:38 pm

Hi all,

So I notice that many websites (most of them anyway) use a clean URL structure like this:

http://www.smashingmagazine.com/category/showcase/

instead of something like http://www.something.com/about.php

The only way I can think of doing something like this is putting index.php or .html or whatever files inside individual folders, but this seems sort of inconvenient and not the best way to do it in general. Could anyone lead me in the right direction? Thanks in advance!
User avatar
wbshim
Smashing <hr />
 
Posts: 51
Joined: Sat Jan 17, 2009 1:02 am
   

   
Take a look at:

Apache
HTAccess
Modrewrite

It is called rewriting a URL.

Both:
http://www.something.com/about.php
and:
http://www.something.com/about-us/

Will work. The location does not change, just some settings in the .htaccess file.
User avatar
Fruityger
Smashing <div>
 
Posts: 155
Joined: Sun Apr 05, 2009 8:22 pm
   

   
Thanks a lot for the help. I'm having a bit of trouble getting it to work though.

Figured the problem out!

So I want to redirect:

http://wbshim.res.cmu.edu/sdcbuggy/raceday09

to

http://wbshim.res.cmu.edu/sdcbuggy/raceday09.php

And it works for the most part, but the stylesheet does not get loaded. The folder /css is in the same folder that the .php files are in. And the relevant part of my .htaccess looks like this:

RewriteEngine on
RewriteRule ^raceday09/$ raceday09.php
RewriteRule ^about/$ about.php
RewriteRule ^members/$ members.php
RewriteRule ^videos/$ videos.php
RewriteRule ^gallery/$ gallery.php
RewriteRule ^history/$ history.php
RewriteRule ^join/$ join.php

any ideas?
User avatar
wbshim
Smashing <hr />
 
Posts: 51
Joined: Sat Jan 17, 2009 1:02 am
   

   
For grand new sites, you may consider using a CMS such as wordpress as it would automatically implement all those clean and nice URLs for you.
Editing & converting photos online: http://www.converthub.com
HTML, CSS, LAMP: http://www.kavoir.com
Web hosting: http://www.shanghaiwebhosting.com
User avatar
kavoir
Smashing <table>
 
Posts: 40
Joined: Sun Feb 08, 2009 4:47 am
Location: kavoir.com
   


Return to Server



Who is online

Users browsing this forum: No registered users and 1 guest