%20%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E7%9A%84%20html%20%E9%A1%B5%E9%9D%A2%E7%9A%84%20URL%20%E9%87%8D%E5%86%99%E9%97%AE%E9%A2%98.png)
我在带有 IIS 6 的 Server 2003 上使用 URL 重写来编写 asp.net (2.0) 应用程序
网站网址示例 mywebsite.com 和 mywebsite.com/blog。
mywebsite.com 运行.aspx 和 .html 页面数据库:SQL Server 2005。
mywebsite.com/blog 已部署 wordpress 数据库:MySQl 5.6
httpd.conf详细信息:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ blog/index.php?p=$1 [NC,L]
主要问题是,使用 httpd.conf 重写代码时,只有 .html 页面不起作用。“收到“哎呀,找不到您要查找的页面“
答案1
以下方法解决了我的问题。现在我可以浏览:
mywebsite.com - .aspx
mywebsite.com - .html
mywebsite.com/blog-.php
文件http.conf:
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} blog
RewriteRule . /blog/index.php [L]