htaccess rewrite question
I am trying to redesign an old website from static to dynamic. Old urls have no distinct common pastern to rely on to make them fully dynamic, except from one single word.
For example:
page a = /folder/some-words.htm
page b = /folder/so开发者_JAVA百科me-other-words-common.htm
page c = /folder/another-strange-word.htm
page d = /folder/another-strange-common2-word-to-explain.htm
Analysis for the pages:
- all are inside /folder/
- page a and page b are linked to each other (user may go from A to B and back to A)
- page c and page d are linked to each other (user may go from C to D and back to C)
- the word [common] is used throughout the pages to pair them
- [common] may have variations (example: common2, commoner, commonaa12)
I was thinking of creating a list of urls in a table for these pairs, to have them in order. Thus, firstpage.php will create pages [a,c,...] and secondpage.php will create [b,d,...).
In the old website there are more parts to change, but these i can manage. Only pages inside /folder/ must be affected by these php pages.
Can someone help me create the rewrite rules in htaccess for these php pages to work as described?
I think it would be better not to support old site urls, but redirect with 301 Responce, like here
Redirect 301 /folder/some-words.htm /folder/some-other-words-common.htm
or like this:
Redirect 301 /folder/ http://www.you.com/newfolder/
精彩评论