HTTP 访问问题
HTTPAccess Issue
我有一个名为 article.php 的文件,它通常会通过 GET 获取参数,例如 id
。我想用 slug
而不是 id
来做一些事情,所以我可以得到类似下面的 URL 的东西:
http://www.website.com/article/slug-goes-here
我的 htaccess 文件可以正常工作,但是每当我加载页面时,我的脚本都会收到 404 错误。
article/css/style.css Failed to load resource: the server responded with a status of 404 (Not Found)
有什么方法可以保留此功能,但保留我的脚本、样式表等的路径?
还有我的 .htaccess:
RewriteEngine On
RewriteRule ^article/([^/]*)$ /article.php?slug= [L]
您需要添加规则才能修复资源:
RewriteRule ^article/(.+?\.(?:jpe?g|gif|bmp|png|tiff|css|js))$ / [NC,L]
我有一个名为 article.php 的文件,它通常会通过 GET 获取参数,例如 id
。我想用 slug
而不是 id
来做一些事情,所以我可以得到类似下面的 URL 的东西:
http://www.website.com/article/slug-goes-here
我的 htaccess 文件可以正常工作,但是每当我加载页面时,我的脚本都会收到 404 错误。
article/css/style.css Failed to load resource: the server responded with a status of 404 (Not Found)
有什么方法可以保留此功能,但保留我的脚本、样式表等的路径?
还有我的 .htaccess:
RewriteEngine On
RewriteRule ^article/([^/]*)$ /article.php?slug= [L]
您需要添加规则才能修复资源:
RewriteRule ^article/(.+?\.(?:jpe?g|gif|bmp|png|tiff|css|js))$ / [NC,L]