Htaccess redirect all url-friendly to index.php


I want to redirect every page to index.php but only those friendly url, not url pointing to css, js jpg or anything with an extension.

How ca we do this?

You need several ingredients:

  • RewriteEngine
  • RewriteCond
  • RewriteRule

Since we’re not here to write your code for you, it’s up to you to combine those ingredients to cook something that works :slight_smile:

Thanks, Remon, you took the words right out of my mouth! Okay, more polite than I would have been but that’s for the better, isn’t it?


You can take the easy way and get a copy of WordPress and use their mod_rewrite code (“script kiddies” do this) or you can take a few minutes and actually learn something (start with the mod_rewrite tutorial Article linked in my signature).