Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 42

Newest Member: Xoote


Old 23.05.2005, 13:56   #1
harshadoak
Baby Mamber
 
Join Date: Aug 2004
Posts: 14
harshadoak is on a distinguished road
Exclamation Changing URLs

My Mambo installation has a habit of constantly changing the URLs displayed.

I have search engine friendly URLs enabled. I am using Mambo 4.5.1 running on a Linux machine. I also have Xaneon Alias Manager 1.0.3a for Mambo 4.5.1 installed.

The problem:
If a URL is shown as

http://www.example.com/content/view/111/49

after some time that same URL might appear as

http://www.example.com/content/view/111/57
http://www.example.com/content/view/111/1
http://www.example.com/content/view/111/54

and so on. Note the changing numbers at the end of the URL.

The page pointed to is the same and I don't get any errors. However the shifting URLs are hurting my sites standing with the search engines.

Google is being good to the site but MSN and Yahoo have just turned their backs on the site. The pages are being indexed by MSN and Yahoo but they fail miseraly in the rankings.

From what I have read, that's primarily because my site URLs keep changing and multiple URLs point to the same content.

Is there a solution for this? I want only one URL per content item. So if a content item is number 111, the URL should always be

http://www.example.com/content/view/111/

If I have configured an alias using alias manager, the URL should always be the alias URL.

BTW has anybody else faced this situation where Google is giving your site 1000s of visitors but MSN and Yahoo are more or less ignoring your site. Any solutions for this?

thanks,
harshad
harshadoak is offline   Reply With Quote
Sponsored Links
Old 23.05.2005, 21:48   #2
crash777
Professional Mamber
 
crash777's Avatar
 
Join Date: Apr 2004
Location: North East USA
Posts: 931
crash777 will become famous soon enough
Default Re: Changing URLs

Quote:
Originally Posted by harshadoak
I have search engine friendly URLs enabled. I am using Mambo 4.5.1 running on a Linux machine. I also have Xaneon Alias Manager 1.0.3a for Mambo 4.5.1 installed.
Try turning one off.. don't they provide the same functionality?
__________________
www.crashgraphics.com
Aaron Monello
crash777 is offline   Reply With Quote
Old 24.05.2005, 06:56   #3
harshadoak
Baby Mamber
 
Join Date: Aug 2004
Posts: 14
harshadoak is on a distinguished road
Default Re: Changing URLs

Thanks for the reply Aaron.

Mambo's search engine friendly URLs just get me URLs in the form www.example.com/content/view/111 instead of urls like

www.example.com/abdc?xyz=122&pqr=000

Xaneon Alias Manager gets me URLs that can have proper explanatory words like www.example.com/news/new_mambo_release.html

So I need both working together.
harshadoak is offline   Reply With Quote
Old 24.05.2005, 18:25   #4
GRAM
Senior Mamber
 
GRAM's Avatar
 
Join Date: Aug 2004
Location: Southern California
Posts: 131
GRAM has a spectacular aura about
Default Re: Changing URLs

harshad,

Sorry for the long post, its a deep issue.

That last number on your url's is an Itemid, which mambo uses to set display parameters and access permissions for the content item. It has nothing to do with selecting what item to display.

If your url that goes to that content item does not have an Itemid on the command line, mambo will assign one based on a best guess method, or it will use the Itemid for the first item on your main_menu (usually the front_page component). This only applies to url's that do not have that last number in them.

Unfortunately, the solution is not contained in just one section of code. You may need to look into hacking the code for each module that creates a url that references a content item. To reduce query times, most modules do not look for indiviual menu entries for content items, they look for section or category menuitems instead. The solution will depend upon the method you employ to access that content item. In most cases mambo will assign the Itemid from the primary menu pick (the section list or content category) to your content item's url.

You could start by reducing the number of access methods you employ for getting to that content item (singular menu item for that section, or that category) to reduce the number of Itemids that could be attached to a singular content item.

The next thing you may need to tackle will be your modules (most popular, latest etc..). Here's a sample of the code from the 'most read' module that came with 4.5.1b:

PHP Code:
// needed to reduce queries used by getItemid
$bs $mainframe->getBlogSectionCount();
$bc $mainframe->getBlogCategoryCount();
$gbs $mainframe->getGlobalBlogSectionCount();
echo 
'<ul>';
foreach (
$rows as $row) {
        
$Itemid $mainframe->getItemid$row->id00$bs$bc$gbs );
        
// Blank itemid checker for SEF
        
if ($Itemid == NULL) {
                
$Itemid "";
        } else {
                
$Itemid "&amp;Itemid=".$Itemid;
        }
        echo 
'<li><a href="' .sefRelToAbs'index.php?option=com_content&amp;task=view&amp;id='$row->id $Itemid ) .'">'$row->title .'</a></li>';
}
echo 
'</ul>'
And here's some sampl code from mainframe->getItemid:

PHP Code:
                if ($_Itemid == '' && $bc) {
                        
// Search in specific blog category
                        
$this->_db->setQuery"SELECT m.id "
                        
."\nFROM #__content AS i"
                        
."\nLEFT JOIN #__categories AS c ON i.catid=c.id"
                        
."\nLEFT JOIN #__menu AS m ON m.componentid=c.id "
                        
."\nWHERE m.type='content_blog_category' AND m.published='1' AND i.id=".$id );
                        
$_Itemid $this->_db->loadResult();
                } 
The code has several sections just like this one, each of which attempts to identify a menu item (see WHERE statement: m.type=, this will exclude anything that does not have a correlating entry in the mos_menu table) that correlates to either that item specifically, or a content section or category that that contains the content item. It executes each section (like the one above) in turn until it finds a valid Itemid, then it returns the Itemid it finds.

mainframe->getItemid first checks for a typed item menu entry that correlates to the item, then for a linked content item (the mod_mostread.php files disables both of these), then it will check to see if the content item is included in a section that is in one of your menus.

If it can't find a menu entry that correlates to either the section for that item, or the category for the item, it will return the current page's url to be used by the mostread module (or whatever routine or script called it). The mostread module will use what it gets back from mainframe->getItemid, and append it onto the url for that item.

It would be complicated to fix, due to the number of scripts (modules) in Mambo that can create a url for a content item. Fortunately most will use this mainframe routine, so you may be able to resolve this by planning around that function for the most part.

Here's a couple of options:

Use a consistant menu linking strategy:

Ensure that each content item has a singular content section path through your menus (each content section should have only one menuentry - not for example both blog AND table entries), and be sure that that menuitem is a content section. If you don't want to have an actual menu entry displayed for that section, create it in a new menu (has to be published) that is displayed in a non used module position.

Category and content_item menu links will have their own Itemids that correlate to their menuitem numbers (thus complicating your problem). You can sompensate for this as follows:

Change any category menu item to a url instead of using mambo's category menu options, and make the url whatever you get in your broswer bar when you go to that category from the primary section menu item (for example click on your section menu item, than select the category you want to make a menuitem for, then copy the url you end up on into your new url menu entry for that category). This new url should have the same Itemid that the section menu item had.

For individual menuitems for content_items within that content section, you would need to change their menu entry types to url as well. Use the same methodology you would use for a category section to get the appropriate url.

The drawback to this approach is lack of control over singular content item displays. Mambo will use the display parameters for that content section since you are using its Itemid.

Or hack your modules (more work to maintain):

You could modify the call to mainframe->getItemid in the mostread module (or whichever module you want to affect) and set it to check for individual item entries in your mos_menu table for content items (it does not do this to reduce query time for each link it creates). Change this line in /modules/mod_mostread.php:

PHP Code:
        $Itemid $mainframe->getItemid$row->id00$bs$bc$gbs ); 
To this:

PHP Code:
        $Itemid $mainframe->getItemid$row->id01$bs$bc$gbs ); 
The third parameter in the mainframe->getItemid function tells this function to look for individual content item entries in your mos_menu table that match this content item.

Next create a phony published menu (set to an unused module position) and create menu items for every content item you want to have a sticky consistant Itemid for that do not already have menu entries in any of your other menus. This would be a pain in the butt to maintain as you would have to create correlating menu items for every content item you want to affect.

It would also slow page rendering very slightly as the affected modules would now be doing one more query per url they create.

This would provide for control over the display of individual pages using the individual menu entrys (Itemid) for each item.

OR do both, and only create phony menu entries for content items that need special handling at display time.

Good luck, it will require some consistant methodology to resolve, but you should be able to do it
__________________
GRAM

Road Star Clinic / MLSHomeQuest.com
GRAM is offline   Reply With Quote
Old 26.05.2005, 19:25   #5
harshadoak
Baby Mamber
 
Join Date: Aug 2004
Posts: 14
harshadoak is on a distinguished road
Thumbs up Re: Changing URLs

Hi GRAM,

Thanks a lot for the detailed reply. I sincerely appreciate the time and effort you have put in.

Based on your suggesitons and info > with some understanding of how the URL creation works in Mambo, I have managed to get closer to a solution.

I changed almost all menu links to URLs and tried to remove the itemid in each case. However the frontpage link it seems has to be
http://example.com/frontpage/Itemid,1/. Could not get http://example.com/frontpage/ or anything else to work.

Strangely http://example.com/frontpage only works till http://example.com/frontpage/Itemid,1/ is also present in the menu. Remove http://example.com/frontpage/Itemid,1/ and http://example.com/frontpage also bombs.

So ItemId 1 was forced on me by the frontpage link and itemid 0 was forced because of some TOCs and category and section links. Even if I state the URL to be http://example.com/content/blogcategory/1/ it seems to work as if the itemid is 0.

So my current fix is that I have created copies of every alias in Xaneon Alias Manager. So dfor example, I have now mapped
www.example.com/content/view/111 , content/view/111/0/ and content/view/111/1/ to the same alias.

This appriach is covering most pages and cases yet there are some links missed.

However I am far better off than earlier.

My menu aliases however have working . So http://example.com/content/blogcategory/1/ is supposed to appear as http://example.com/news/ and that mapping is very much present in Alais Manager and if I say http://example.com/news, I get the xorrect page. But by default the link appears as http://example.com/content/blogcategory/1/ and not http://example.com/news. Not sure why these aliases have stopped working.

thanks,
harshad
harshadoak is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SEF URLs through sitemap not working pgupta Development Discussions 0 26.04.2005 12:11
SEF urls without mod_rewrite ufo Mambo 4.5.1 'How Do I' Questions 3 18.02.2005 09:41
Dynamic Title Override yipppie Mambo 4.5.1 General Talk 75 31.01.2005 20:00
SEF URLs with Gallery Integration LogicX Mambo 4.5 General Talk 3 14.08.2004 11:51
mosbreak and changing images problem mambomaster Mambo 4.5 'How Do I' Questions 0 05.07.2004 22:28


All times are GMT +2. The time now is 22:01.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.