views:

22

answers:

2

I have a really convoluted website that I need to work on. I was thinking on creating a single "home" php file that includes the main stuff (menu, sidenav, head, etc) and inserting the content for every page. I already have the content from all the pages separated so I have a duplicate of the site where all the html files have only the inner content ( i mean no , no menues, nothing except for the content). I would like to know if there is a way to redirect from any link that looks like www.site.com/example.html to www.site.com/script.php?url=example . That way, I can use the variable to insert the content files, or is there any other way to do such a thing?

+2  A: 
Sarfraz
mod_rewrite is a pretty common practice these days, no? As long as he doesn't mean a literal url as the PHP $_GET variables, he can validate the parameter against a list of verified strings. Pretty standard stuff in most frameworks.
Mike Sherov
I just want to do that so i dont have to change every link on 500+ html files... so Im looking for a way to server redirect every link that goes to "site.com/something/hello.html" and bring up "site.com/script.php?url=something/hello(.html)" I can do some url rewriting after to hide the script.php... but my main concern if it can be done
Bruno
Wrikken
A: 

Already find a solution...

(.*) http://www.example.com/script.php?$1

where $1 is the variable c

Bruno