mod_rewrite for all pages (including subfolders) on a site to a single php page

后端 未结 2 1910
闹比i
闹比i 2020-12-19 17:25

I am in the process of converting my site with many static html pages to a site driven by a database. My problem is that I don\'t want to lose what google has already indexe

2条回答
  •  北海茫月
    2020-12-19 18:06

    I would recommend you to look into the Apache URL Rewriting Guide, it contains extensive information about rewriting with examples.

    If I understand you correctly, you should be able to use something like this

    RewriteEngine on
    RewriteCond $1 
    RewriteRule ^(.*)$ index.php/?page=$1 [L]
    

    Which is very similar code to the one you posted. If you want better information, be specific about your problem.

提交回复
热议问题