2013-02-26 118 views
0

我有一个旧的Joomla网站,我想转移到WordPress。我们有很多在我们的Joomla网站,像这样的老新闻条目...htaccess重写问题

/home/news-and-offers/news/476-new-bridal-boutique-posh-frocks-has-opened.html 
/home/news-and-offers/news/594-fabulous-new-offer-from-hall-hotel-and-spa-in-birmingham.html 
/home/news-and-offers/news/596-win-your-dress-for-free-this-week-at-berketex-bride.html 
/home/news-and-offers/news/602-ask-alice-get-your-big-day-questions-answered.html 
/home/news-and-offers/news/637-get-down-to-the-west-countrys-largest-wedding-exhibitions.html 

,我想批量重定向到...

/category/wedding-news/ 

我将如何去写一个正则表达式要做到这一点作为我不想将所有这些文章添加到我的htaccess文件。

在此先感谢,詹姆斯

+1

所以基本上任何以'/家/新闻和offerings'应重定向?你打算保留ID,还是只发送一些东西到同一个地方? – mariusnn 2013-02-26 15:58:54

+1

'/ home'是系统路径中URL路径或'home'中的文件夹?总之,'/ news /'中的所有URL都应该重定向? – 2013-02-26 16:10:45

+0

嗨Faa,这是在系统路径 - 不是一个文件夹 - 它是由joomla – 2013-02-26 16:13:23

回答

0

把这样的事情在/.htaccess重定向一切/home/news-and-offers/category/wedding-news

RewriteEngine on 
RewriteRule ^/home/news-and-offers/ /category/wedding-news/ [R=301] 
+0

您好mariusnn,感谢您的回复。我已经尝试过了,但它不起作用:-( – 2013-02-26 16:11:10

+0

您是否收到任何错误消息或任何内容? joomla是否有.htaccess-config某处?(或者甚至在Apache主机配置文件中) – mariusnn 2013-02-27 09:21:52

+0

没有错误消息 - 这是一个WordPress htacess文件,我正在写这篇文章。你需要看看内容吗? – 2013-02-27 12:42:15