Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Website Reorganization - Dynamic Menu Ids And Item Ids - Redirects?


  • Please log in to reply
5 replies to this topic

#1 bobmeetin

bobmeetin

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 533 posts
  • Location:Colorado

Posted 19 January 2010 - 11:27 AM

Every now and then we have the need to do some major website reorganization. With HTML sites you move a page or link to below a different menu - no problem, the URL name doesn't change, just the access point.

But commonly with dynamic websites you can't stand behind diplomatic immunity. You move a link from dropdown menu item #3 to another location and the menu ID changes. In this example search engine friendly or user friendly URLs is not enabled. Example:

ID = the page or article ID
Itemid = the menu ID

CODE
index.php?option=com_content&view=article&id=136&Itemid=[b]298[/b]


Move it to under another menu and you end up with:

CODE
index.php?option=com_content&view=article&id=136&Itemid=[b]320[/b]


And the concern develops. When the search engine indexed the page originally I assume that all the juice is attached to the page with ID 136 and Itemid 298. But now although the content has not changed it is now living as Itemid 320.

The idea of setting up a 301 redirect comes to mind but I'm wondering if there is a better solution. This can make for a long .htaccess file. Over???

#2 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,708 posts
  • Location:Blackpool UK

Posted 19 January 2010 - 12:56 PM

Was the CMS written by somebody with a sense of humour?? Why would anybody in their right mind change the URI simply because the menu order changed??


Although with "com_content" in the URI I'm taking a stab at Joomla (or it's forerunner Mambo). In which case they definitely had a sense of humour with some of the strange things it does!!!!

biggrin.gif biggrin.gif

#3 bobmeetin

bobmeetin

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 533 posts
  • Location:Colorado

Posted 19 January 2010 - 02:10 PM

Yadda yadda - yes to Joomla. The bottom line, however, is there an out?

Installing sh404SEF or similar may be a future out in that I can craft the URL names probably more like static HTML button, but that doesn't really solve this problem.

#4 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 19 January 2010 - 02:52 PM

This is one place I don't think I'd do it via .htaccess if you're talking more than a page or two. A page or two and .htaccess would be fine, but more than that and it starts to get silly and unworkable in a hurry.

Instead I'd tweak the code of index.php to actively look for one or both of the ID's that had been changed, setting this up in a little Case/Switch scenario, and do a scripted redirect when there's a positive match.

Easier, cleaner and faster.

#5 bobmeetin

bobmeetin

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 533 posts
  • Location:Colorado

Posted 21 January 2010 - 06:03 PM

QUOTE(Randy @ Jan 19 2010, 12:52 PM) View Post
This is one place I don't think I'd do it via .htaccess if you're talking more than a page or two. A page or two and .htaccess would be fine, but more than that and it starts to get silly and unworkable in a hurry.

Instead I'd tweak the code of index.php to actively look for one or both of the ID's that had been changed, setting this up in a little Case/Switch scenario, and do a scripted redirect when there's a positive match.

Easier, cleaner and faster.


Much easier said than done. If you haven't work with Joomla/similar or even if you have, this is complicated because of the rather 'robust' framework. 10-15 URLs might take 15 minutes to a half hour to redirect using htaccess but many times more through hunt/peck with the application because of all the include file/functions that you would need to fend through. Bummer...

#6 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 21 January 2010 - 07:47 PM

I haven't worked with Joomla in forever. But will it allow you to use a php include statement at the top of the main template? Probably not in the template that can be edited via your browser in the admin area. I'm thinking about in the real .php file itself.

If you can fire in one php include you could put the scripted redirect code there. The only caveat being that it'll have to be at the absolute top of the page. Otherwise html headers will have already been sent and throw an error.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!