1

I need to rewrite some URLs for a site using htaccess, and am struggling with getting it to work. These are the ones I need to do:

Remove extensions

http://domain.co.uk/services.php            >   http://domain.co.uk/services
http://domain.co.uk/about-us.php            >   http://domain.co.uk/about-us
http://domain.co.uk/knowledge-base.php      >   http://domain.co.uk/knowledge-base
http://domain.co.uk/quotation-tool.php      >   http://domain.co.uk/quotation-tool

Remove Query Strings

http://domain.co.uk/services.php?service=something     > http://domain.co.uk/services/something

http://domain.co.uk/services.php?cat=foo&s=bar         > http://domain.co.uk/services/foo/bar

http://domain.co.uk/knowledge-base.php?cat=something   > http://domain.co.uk/knowledge-base/something

http://domain.co.uk/knowledge-base.php?cat=foo&s=bar   > http://domain.co.uk/knowledge-base/foo/bar

I need it to work so someone typing in the updated version gets served the correct page. Any help greatly appreciated

Mike Harrison
  • 1,020
  • 2
  • 15
  • 42

0 Answers0