我不得不重新设计一个Joomla列表网站,网站使用一个组件来显示列表。每个项目的url如下
example.com/gulf-job-listing/jobs/items/view/xxxxx
xxxx通常是id和别名的组合,所以可能是这样的
example.com/gulf-job-listing/jobs/items/view/1-programmer
无论如何,我要做的是,将所有example.com/gulf-job-listing/jobs/items/view/xxxxx的urls重定向到example.com/海湾工作列表
我试图使用Joomla内核重定向,但我只能将一个url重定向到另一个url。也就是说,我将example.com/海湾-作业-列表/作业/项目/视图/重定向到example.com/海湾-工作列表
我的.htaccess文件如下
Options +FollowSymLinks
Options -MultiViews
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteBase /
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example.com [NC]
RewriteRule (.*) http://example.com/$1 [R=301,L] 发布于 2015-05-18 08:16:35
如果我理解得对,就把这行放在RewriteEngine之后
RewriteRule ^gulf-job-listing/jobs/items/view/ /gulf-job-listing [L,R]https://stackoverflow.com/questions/30297608
复制相似问题