简体   繁体   English

将Joomla 1.5 URL重定向到同一域中的wordpress

[英]Redirect Joomla 1.5 URLs to wordpress in the same domain

I have tried different methods to redirect Joomla 1.5 url to Wordpress page for following URLs in htaccess are not working. 我尝试了其他方法将Joomla 1.5 URL重定向到Wordpress页面,因为htaccess中的以下URL无法正常工作。

Joomla old url 1) Joomla旧网址1)

http://www.example.com/index.php?option=com_content&view=article&id=55:psychiatry&catid=23:doctor&Itemid=48 http://www.example.com/index.php?option=com_content&view=article&id=55:psychiatry&catid=23:doctor&Itemid=48

Wordpress new url 1) WordPress的新网址1)

http://www.example.com/psychiatry/ http://www.example.com/psychiatry/

=================== ===================

Joomla old url 2) Joomla旧网址2)

http://www.example.com/index.php?option=com_content&view=article&id=52&Itemid=55 http://www.example.com/index.php?option=com_content&view=article&id=52&Itemid=55

Wordpress New url 2) WordPress的新网址2)

http://www.example.com/pharmaceutical/ http://www.example.com/pharmaceutical/

Please help. 请帮忙。

Thanks. 谢谢。 Mizan 美赞

You can use these .htaccess rules for both cases: 在两种情况下,您都可以使用以下.htaccess规则:

These rules check for each parameter in the query string of the request. 这些规则检查请求的查询字符串中的每个参数。 You can remove irrelevant parameters as needed. 您可以根据需要删除不相关的参数。

First URL rewrite: 第一次URL重写:

?option=com_content&view=article&id=55:psychiatry&catid=23:doctor&Itemid=48 --> /psychiatry/ ?option = com_content&view = article&id = 55:psychiatry&catid = 23:doctor&Itemid = 48-> / psychiatry /

RewriteBase /

RewriteCond %{QUERY_STRING} option=com_content [NC]
RewriteCond %{QUERY_STRING} view=article [NC]
RewriteCond %{QUERY_STRING} id=55:psychiatry [NC] 
RewriteCond %{QUERY_STRING} catid=23:doctor [NC] 
RewriteCond %{QUERY_STRING} Itemid=48 [NC] 
RewriteRule ^.*$ /psychiatry/? [L,R=301]

Second URL rewrite: 第二个URL重写:

?option=com_content&view=article&id=52&Itemid=55 --> /pharmaceutical/ ?option = com_content&view = article&id = 52&Itemid = 55-> / pharmaceutical /

RewriteCond %{QUERY_STRING} option=com_content [NC]
RewriteCond %{QUERY_STRING} view=article [NC]
RewriteCond %{QUERY_STRING} id=52 [NC] 
RewriteCond %{QUERY_STRING} Itemid=55 [NC] 
RewriteRule ^.*$ /pharmaceutical/? [L,R=301]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM