English 中文(简体)
SEO mod_rewrite Internal uriarch questions
原标题:SEO mod_rewrite internal uri directory problems

我有一条改写规则,修改<代码>example.com/en/about/topic至example.com/en/view.php?p=pages/about/topic.php

我的规则是:

Rewrite Rule ^en/([a-zA-Z0-9/]+)$ en/view.php?p=pages/$1.php

观点。 php有我所坚持的脚.,如菜单、木.等,它使用一个包含网页/图像的营地。 php

它使用<条码>example.com/en/topic-> example.com/en/view.php?p=pages/topic.php,但当我尝试<条码>example.com/en/about/topic-> example.com/en/view.php?p=pages/about/topic.php和,但试图从

我是今天的。 虽然我确实发现了 mo树_和一对handyguides

这里,我的记录就是这样说的。 com/en/测试(奏效):

[perdir C:/tt/xampp/htdocs/] rewrite en/test -> en/view.php?p=pages/test.php

[perdir C:/tt/xampp/htdocs/] strip document_root prefix: C:/tt/xampp/htdocs/en/view.php -> /en/view.php

[perdir C:/tt/xampp/htdocs/] internal redirect with /en/view.php [INTERNAL REDIRECT]

[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/view.php

[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/base/code/view.css

and for example.com/en/about/test (which does not)

[perdir C:/tt/xampp/htdocs/] rewrite en/about/dir/test -> en/view.php?p=pages/about/dir/test.php

[perdir C:/tt/xampp/htdocs/] strip document_root prefix: C:/tt/xampp/htdocs/en/view.php -> /en/view.php

[perdir C:/tt/xampp/htdocs/] internal redirect with /en/view.php [INTERNAL REDIRECT]

[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/view.php

[perdir C:/tt/xampp/htdocs/] C:tt/xampp/htdocs/en/about

Any help would be much appreciated!

最佳回答

你以某种方式提出错误的问题。 你们给你的工作和做你想要的事情的规则。 您的问题是,当客户浏览器要求<代码>example.com/en/about/topic时,这些文字正为您的中央支助事务、图像等签发相对地址,其中包括一个相对链接<代码>href=“基准/代码/view.cs”,client

example.com/en/about/base/code/view.css

Given that you don t want to change your scripts, your challenge is therefore to recognise this type of pattern and strip out the extraneous directories that the SEO encoding introduces, so if this case is example.com/en/<don t care>/base/code/... then the following type of rule will do what to want

RewriteRule en/.+?/base/code/(.*) en/base/code/$1   [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!

热门标签