The Joomla! Forum ™






Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Mar 14, 2012 6:02 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 11, 2008 5:09 am
Posts: 11
I roughly have five articles that need to change to another section and category. So, i want to redirect the old articles URL to the new URL.

The website is using joomla default SEF.

Example of the Old URL:
http://www.domain.com/component/content ... title-name

So, i want to move it to the new URL at the same website.

i have try to add the following to the htaccess file, but it does not work.
Code:
RewriteRule ^component\/content\/article\/34-gallery\/58-article-title-name$ "http://www.domain.com/newurl" [R=301,L]


just for you information, the htaccess file also include the Non WWW to WWW version redirection.

Could someone please help? Thank in advance


Top
 Profile  
 
PostPosted: Wed Mar 14, 2012 6:44 am 
Joomla! Explorer
Joomla! Explorer

Joined: Tue Feb 08, 2011 8:46 am
Posts: 294
I'm not sure I understood this properly. But did you try changing the Article being called by the menu items to the new article manager?

_________________
Vidur Bharany


Top
 Profile  
 
PostPosted: Wed Mar 14, 2012 7:20 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 11, 2008 5:09 am
Posts: 11
vidurb wrote:
I'm not sure I understood this properly. But did you try changing the Article being called by the menu items to the new article manager?


Thank for your reply. Could you please tell me a bit more detail? I'm not sure how to do that.


Top
 Profile  
 
PostPosted: Fri Mar 16, 2012 11:39 am 
Joomla! Explorer
Joomla! Explorer

Joined: Tue Feb 08, 2011 8:46 am
Posts: 294
Go to Menu Manager and Open up the menu item that calls a single article. Once this is open look on the right side, where it lets you select the article to display. Use this to select the new article that you want this menu item to display.

_________________
Vidur Bharany


Top
 Profile  
 
PostPosted: Mon Mar 19, 2012 1:27 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 11, 2008 5:09 am
Posts: 11
Thank for your reply vidurb. However i think this is not what i mean. Because i want to redirect the old article ulr to the new article url. This is to make sure that when user access the old article url will be redirected to the new article URL.

I trid using the above mod_rewrite at htacess file but with no success. Could someone help?

Thanks


Top
 Profile  
 
PostPosted: Mon Mar 19, 2012 1:52 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Tue Feb 23, 2010 8:16 pm
Posts: 294
Location: Lancaster UK
I'm not sure if you want to redirect five article individually or move a group of five from one path to another.

Here are two ways to go:

Redirecting indivibual pages:-

Redirect 301 component/content/article/34-gallery58-article-title-name /newurl

Redirect a folder/section/category to another:-

RewriteRule ^component/content/article(.*)$ /content/article$1 [R=301,L]

The second example removes the 'component' from the URL, simply add or remove folders/paths on the second part of the string.

_________________
Joomla Expert http://www.deanmarshall.co.uk/joomla-expert.html Expert Joomla Development and Support
Music For Schools http://www.musicforschoolsltd.co.uk/ Primary Schools Summer Musicals


Top
 Profile  
 
PostPosted: Thu Mar 22, 2012 8:55 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 11, 2008 5:09 am
Posts: 11
Thanks for your reply Harvey51.

Because i'm using the joomla default SEF which is using the mod_write for SEF. So can we mix Redirect 301 and RewriteRule in one .htaccess file? Because i read one post here viewtopic.php?t=634003

Quote:
If you use RewriteRule for any of your rules, you must use it for ALL of your rules.

RewriteRule is parsed by mod_rewrite. Redirect is parsed by mod_alias.

The .htaccess file is parsed in "per module" order.

The problem is that if your server runs mod_rewrite before it runs mod_alias your internal rewritten paths will be exposed as new URLs.

Instead of

Redirect 301 /oldfolder http://www.example.com/newfolder

use

RewriteRule ^oldfolder/(.*) http://www.example.com/newfolder/$1 [R=301,L]


Make sure that external redirects are listed before internal rewrites.

Make sure the non-www to www external redirect is the last redirect before the internal rewrites.

The htaccess.txt file that comes with the latest version of Joomla shows exactly where in the file external redirects should be placed.


I'm actually not so understand what it mean.


Top
 Profile  
 
PostPosted: Thu Mar 22, 2012 1:11 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Tue Feb 23, 2010 8:16 pm
Posts: 294
Location: Lancaster UK
It's an interesting post, one point is the use of 'if':-

"The problem is that if your server runs mod_rewrite before it runs mod_alias your internal rewritten paths will be exposed as new URLs."

This post is by user g1smd, I've seen him post many times. On htaccess files he has possibly the best knowledge you will find on this site.

I've seen him post this comment on another site, but I've never seen anybody else make this point. I understand what he means as it relates to internal rewrites and external redirects. As for the potential to crisscross them and lose page/link juice, he says:-

"Make sure the non-www to www external redirect is the last redirect before the internal rewrites."

Unless I'm missing something that's a contradiction? but as I said, g1smd really knows his stuff. I personally mix them and until I hear others saying not to and why, or I'm pointed to a resource that explains this I'm going to keep mixing them, because I don't know why internal rewrites would been seen as external redirects.

I guess you'll have to make up your own mind.

_________________
Joomla Expert http://www.deanmarshall.co.uk/joomla-expert.html Expert Joomla Development and Support
Music For Schools http://www.musicforschoolsltd.co.uk/ Primary Schools Summer Musicals


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 



Who is online

Users browsing this forum: emanipur and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group