我不得不重新设计一个Joomla列表网站,该网站使用一个组件来显示列表。每个项目的网址如下
example.com/gulf-job-listing/jobs/items/view/xxxxx
xxxx通常是id和别名的组合,所以它可能是这样的
example.com/gulf-job-listing/jobs/items/view/1-programmer
无论如何,我想要做的是将所有urig重定向到example.com/gulf-job-listing/jobs/items/view/xxxxx example.com/gulf-job-listing
我尝试使用Joomla核心重定向,但我只能将一个网址重定向到另一个网址。即我将example.com/gulf-job-listing/jobs/items/view/重定向到example.com/gulf-job-listing
我的.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]
答案 0 :(得分:1)
如果我理解正确,请将此行放在RewriteEngine之后
RewriteRule ^gulf-job-listing/jobs/items/view/ /gulf-job-listing [L,R]