English 中文(简体)
.htaccess redirect question
原标题:.htaccess redirect question

我对接驳方向稍有问题。

我有一个具有2级变量(内容=“类型——(甲型)”和ID=编号)的动态站点,但这并非对我真心想要形成的一种改写规则,为每个发动机和安放机生成一种“友好的”舱;用户也一样。 真像是言辞。

每一国际发展指标都已经是独特的(显而易见的),在创建时,都创造了一个独特的“适当链接”领域,例如,ID=1有一个“适当链接”领域,因为“2009/10/27/网页标题”和ID=100将是“2010/10/27页标题”。

我想翻翻一番/墙.php?content=打字和复制;ID=编号改为翻纸/permalink。 php/html/htm

任何杂质? ——这并非正确(我知道),而是我的卷宗“突破”。

RewriteEngine On

RewriteRule wall/content/(.*)/ID/(.*)/ wall.php?content=$1&ID=$2
RewriteRule wall/content/(.*)/ID/(.*) wall.php?content=$1&ID=$2
最佳回答

你们需要确保有一个与服务器上的其他档案有冲突关系的《URL公约》。 例如,如果您的网页显示“产品”,而您的服务器称作产品/产品,其根基上没有实际文件夹,你就可以这样做。

RewriteEngine On
RewriteRule ^products/([^/.]+)/([^/.]+)/?$ wall.php?content=$1&id=$2 [L,NC,QSA]

以最合适的名称取代“产品”。 php网页的确如此。

这等于以下的URL。

www.yoursite.com/products/title/29/

哪一会改写

www.yoursite.com/wall.php?content=title&id=29
问题回答

暂无回答




相关问题
Ignore symlinks in clean URL s in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. ...

.htaccess File Options -Indexes on Subdirectories

I have the following .htaccess line, simple no indexes on root. Options -Indexes What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on ...

Mod Rewrite ignoring -d

After a day or two, I am still fighting with Mod Rewrite. It seems that 60% of my development time is spent battling the server. My current URL structure is such that all http://example.com/xyz and ...

ErrorDocument 404 Not Sending Referrer Information: PHP

I m using a standard htaccess ErrorDocument 404 to redirect users to a new page. In order to customize the 404, I need to know their referrer information (from the page they Tried to visit). $...

Find all htaccess files on server [closed]

I m looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date ...

301 Redirect Help with Dynamic URL s and Multiple Id s

I just did a redesign for www.wildchildclothes.com which has a new URL structure. The old site ran on Zen Cart and had a bad URL structure. Here are some examples of what I want to redirect from: OLD:...

热门标签