URL rewriting - Beginners guide

前端 未结 2 916
广开言路
广开言路 2021-01-24 04:38

I need to learn how to do URL rewriting for a site to get pretty URLs...

I have a general idea of how it works through the 50 tutorials I read. But none of them really

2条回答
  •  离开以前
    2021-01-24 05:30

    Have a play with something like CodeIgniter, Wordpress, or Drupal. You can see how the URLs are formed and how they map to the contents of .htaccess.

    This mod_rewrite cheatsheet is very useful.

    Given that your stylesheets are already referenced absolutely (they include http://www.dico2rue.com/) it's probably because you're telling all your images, stylesheets and JavaScript files to go through index.php. Instead you need to tell .htaccess to leave physical files alone, and only parse other URLs.

    Post what you have in your .htaccess file here and I'm sure we can help fix it.

提交回复
热议问题