English 中文(简体)
修改- 重写重定向
原标题:Mod_Rewrite Redirect

我对主机主机的mod_restrite有问题。 所有人都工作顺利, 但是现在我改变了我的目录组织, 所以所有在更改前被Google索引的网页都有错误的扩展名( 我决定在名称结尾处添加一个 html, 现在 URls 看起来像“ www. mydomain.com/ page_ page/ page_ id/ name_of_resource.html ”, 而在它像“ www. mydomain. com/ page_ name/ details_ on_ page/ page_id/ name_of_resource” 之前, 并返回一个404 错误 。

我怎样才能写出一个 mod_refrite COND 和一条规则, 将301页与缺失的 html 扩展到.html 页面的 301 页?

谢谢!

最佳回答

尝试此 :

RewriteEngine On
RewriteCond %{REQUEST_URI} !.html$
RewriteRule ^page_name/(.+)$ /page_name/$1.html [R=301,L]
问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签