Web Servers on Unix and Linux - Need htaccess trick to redirect html to php pages

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > May 2004 > Need htaccess trick to redirect html to php pages





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Need htaccess trick to redirect html to php pages
Andy Rigby

2004-05-14, 12:56 pm

Hi

I'm transferring my site from static pages which are all called
[productcode].html, to a php solution that will have one standard
product page (product.php) and will take the product code to display
as a parameter eg www.mysite.com\product.php?id=12345

I'd like to make sure that all search engine links and other links
that currently go straight to an HTML product page will still be able
to find the correct page, so I thought I'd see if it can be done with
a neat .htaccess redirect.

eg

redirect *.html *.php?id=????? (syntax obviously not perfect!)

I'm hopeless at the expression parsing bit of htaccess and wondered if
anyone has done a similar thing before. It will need to be able to
exclude certain files (eg index.html) from the redirects, although I
could even get round this if it's not possible.

Andy
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com