我用一些.php文件和一些.html创建了PHP网站,这意味着一些文件有动态内容,有些文件是静态的。
对于动态页面,我已经完成了重定向。类别页面,产品列表和产品详细信息页面的重定向如下所示:
http://localhost/project_name/categories.html
http://localhost/project_name/category-name/product-name.html
现在我想重定向静态页面,如下所示:
我已经在我的.htaccess中添加了该页面的条件,如下所示:
RewriteRule ^factory.html$ factory.html [R,L]
我已经完成了以下答案:
htaccess redirect index.html to index.php for domain root only
https://css-tricks.com/how-to-redirect-indexhtml-to-indexphp/
请检查我的以下完整.htccess文件:
Options -Multiviews
Options +FollowSymLinks
Options +FollowSymLinks
RewriteEngine On
RewriteBase /granite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^factory.html$ factory.html [R,L]
RewriteRule ^monuments-tombstones.html(.*) monuments-products.php?url=$1
RewriteRule ^monuments-tombstones+/([a-zA-Z0-9-]+).html$ mproduct-detail.php?url=$1
RewriteRule ^cobble-setts.html(.*) cobble-products.php?url=$1 [QSA,L]
RewriteRule ^cobble-setts+/([a-zA-Z0-9-/]+).html$ cproduct-detail.php?url=$1 [L,QSA,NC]
RewriteRule ^[A-Za-z-]+.html?$ products-category.php?u=$1 [NC,L]
RewriteRule ^[A-Za-z-]+/([A-Za-z0-9-]+).html?$ product-detail.php?u=$1 [NC,L]
ErrorDocument 404 /404page.php
请帮我解决这个问题。