Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7410735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:16:44+00:00 2026-05-29T06:16:44+00:00

I have a problem with a magento installation. I used Magento ver. 1.5.0.1, community

  • 0

I have a problem with a magento installation. I used Magento ver. 1.5.0.1, community edition to develop this website http://cissmarket.com/.

The problem appears when I change the language from the EU version to French and after that to German. The change to french is ok, but when in the same page i change to German i receive a 404 error. Also this is generation 404 errors in the Google webmaster tools and when i try for example to take this link and paste it in the browser it gives me also a 404 error. I have there some 50 products and ~550 404 errors in Google Webmaster tools. I understand that the problem is from what I described.

Moreover I have a SEO problem since I have this page in french:

http://cissmarket.com/de/cartouches-refilables.html

And when I switch to the german version of the website it takes me to this link

http://cissmarket.com/de/cartouches-refilables.html?___from_store=fr (if i try now to switch to uk I will get the 404 mentioned above)

instead of going to this one:

http://cissmarket.com/de/nachfullpatronen.html

Already checked this 404 error when switching between stores when in a category on magento but it does not relate to my problem.

About settings:

  • I use the caching service and also I did index all the content.
  • The product or category I am trying to access is available and set active for all the languages.
  • System > General > Web > URL options > Add Store Code to Urls is set
    to yes.
  • System > General > Web > Search Engines Optimization > Use Web Server
    Rewrites is set to yes.
  • No other changes has been made to the .htaccess file except for the
    ones that the system itself made.

So to conclude: the problem is the 404 given by 2 succesive changes of the language and the bad url address when I switch from one page to another.

Any suggestions would be appreciated.

UPDATE: tried this http://www.activo.com/how-to-avoid-the-___from_store-query-parameter-when-switching-store-views-in-magento but it results in a 404 at the first language change

Edit #1:

Found the problem: file languages.phtml contained this code <?php echo str_replace ("/fr/","/de/",$_lang->getCurrentUrl()); ?> and actually did replace only the language code and not the whole url according to the corresponding translation.

So applied to this

http://cissmarket.com/fr/cartouches-refilables.html

it will return

http://cissmarket.com/de/cartouches-refilables.html

So does anyone know how to get the corresponding URL of the current page for the other languages available in the store?

Edit #2 (using @Vinai solution):

It works on the product pages but not on the category yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:16:45+00:00Added an answer on May 29, 2026 at 6:16 am

    There is no such thing in the native Magento as far as I know.
    That said, you can use the following code to get the current page URL for each store.

    $resource = Mage::getSingleton('core/resource');
    $requestPath = Mage::getSingleton('core/url')->escape(
        trim(Mage::app()->getRequest()->getRequestString(), '/')
    );
    
    $select = $resource->getConnection('default_read')->select()
        ->from(array('c' => $resource->getTableName('core/url_rewrite')), '')
        ->where('c.request_path=?', $requestPath)
        ->where('c.store_id=?', Mage::app()->getStore()->getId())
        ->joinInner(
            array('t' => $resource->getTableName('core/url_rewrite')),
            "t.category_id=c.category_id AND t.product_id=c.product_id AND t.id_path=c.id_path",
            array('t.store_id', 't.request_path')
        );
    $storeUrls = (array) $resource->getConnection('default_read')
        ->fetchPairs($select);
    

    This will give you an array with the array key being the store IDs and the array values being the request path after the Magento base URL, e.g. assuming your French store has the ID 1 and the German one has the ID 2, you would get:

    Array
    (
        [1] => cartouches-refilables.html
        [2] => nachfullpatronen.html
    )
    

    Then, in the foreach loop where the URL for each store is output, use

    <?php $url = isset($storeUrls[$_lang->getId()]) ? $_lang->getUrl($storeUrls[$_lang->getId()]) : $_lang->getCurrentUrl() ?>
    

    The call to $_lang->getUrl() will add the base URL, so you will get the full URL for each store (e.g. http://cissmarket.com/de/nachfullpatronen.html). If no store view value is found in the core_url_rewrite table it will revert to the default behaviour.

    You still need the ___store=fr query parameter because otherwise Magento will think you are trying to access the new path in the context of the old store. Luckily, the getUrl() call an the store model adds that for you automatically.

    The code querying the database can be anywhere of course (since its PHP), even in the template, but please don’t put it there. The correct place to have code that access the database is a resource model. I suggest you create a resource model and put it in a method there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Magento 1.7.0.2 Community Edition and I have encountered a big problem
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar
I am looking to set-up a Magento (Community Edition) installation for multiple clients and
Building a website using a PHP based Ecommerce product Magento. The problem I have
I have problem with tooltips on my magento website, I need to have one
I have just reported a bug to Magento (http://www.magentocommerce.com/bug-tracking/issue?issue=11842) and I was wondering if
I have a problem with my Magento installation. When I'm loged in to the
i have a two store magento installation, and i have a problem with home
I am new in magento eCommerce. I have this problem: here, ¥27 is shown
I have this problem with Headers already sent with Magento. I get this error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.