View Issue Details

IDProjectCategoryView StatusLast Update
0002827OXID eShop (all versions)4.09. SEO, SEO URLpublic2012-12-10 13:34
Reportertjungcl 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version4.5.0 revision 34568 
Target VersionFixed in Version4.5.3 revision 39087 
Summary0002827: oxseodecoder->decodeUrl accepts and decodes expired urls without notice
Descriptionconnected to, but NOT duplicate of 0002783

- oxseodecoder->decodeUrl is called exactly once: in oxseodecoder->processSeoCall
- if the given url is expired, decodeUrl decodes it anyway without doing anything special

=> on the first call of an expired url, no redirect happens.

- now the product stores its new url into the oxseo table and moves the expired url to history.

=> on all following calls of the expired url, the redirect happens correctly.

So in the long term it works all fine, but expired urls work fine and are still valid for one call of the expired url, although you would expect it to be invalid.

As consequence search robots like the google crawler a informed about url-changes one scan later, which in many cases makes a difference of several days!
Steps To Reproduce- Open /Gear/Fashion/For-Her/Jeans/Kuyichi-Jeans-ANNA.html
- Open admin, rename ANNA to ANNA2
- Open /Gear/Fashion/For-Her/Jeans/Kuyichi-Jeans-ANNA.html again
=> it still works, but the url is NOT redirected to ...ANNA2.html
- Open /Gear/Fashion/For-Her/Jeans/Kuyichi-Jeans-ANNA.html again
=> it still works, and now the url is correctly redirected to ...ANNA2.html
Additional Informationto fix, you could handle expired urls similar to oldurls in proccessUrl:
- decodeUrl decodes no expired url, so returns false
- next a new function _decodeExpiredUrl is called, which identifies the expired url, calcutates a new one and returns it
- next the _decodeOldUrl function is called as it is now

also, you could change public decodeUrl to protected _decodeUrl
TagsNo tags attached.
Theme
BrowserAll
PHP Versionany
Database Versionany

Relationships

related to 0002783 resolvedarvydas_vapsva SEO decoder decodes history-url into expired-url 

Activities

tjungcl

2011-05-04 10:26

reporter   ~0004451

to clarify what my suggestion would look like:
The part i mean now is:

// in case SEO url is actual
            if ( is_array( $aGet = $this->decodeUrl( $sParams ) ) ) {
                $_GET = array_merge( $aGet, $_GET );
                oxLang::getInstance()->resetBaseLanguage();
            } elseif ( ( $sRedirectUrl = $this->_decodeOldUrl( $sParams ) ) ) {
                // in case SEO url was changed - redirecting to new location
                oxUtils::getInstance()->redirect( $this->getConfig()->getShopURL().$sRedirectUrl, false );

It could instead be:
// in case SEO url is actual (this time REALLY actual)
            if ( is_array( $aGet = $this->decodeUrl( $sParams ) ) ) {
                $_GET = array_merge( $aGet, $_GET );
                oxLang::getInstance()->resetBaseLanguage();
            } elseif ( ( $sRedirectUrl = $this->_decodeExpiredUrl( $sParams ) ) ) {
                // in case SEO url is expired - calculating and redirecting to new location
                oxUtils::getInstance()->redirect( $this->getConfig()->getShopURL().$sRedirectUrl, false );
            } elseif ( ( $sRedirectUrl = $this->_decodeOldUrl( $sParams ) ) ) {
                // in case SEO url was changed - redirecting to new location
                oxUtils::getInstance()->redirect( $this->getConfig()->getShopURL().$sRedirectUrl, false );

arvydas_vapsva

2011-09-26 14:10

reporter   ~0005265

Last edited: 2011-09-26 15:58

View 2 revisions

are you familiar with '<link rel="canonical" href="...">' we use in shop? This solves such cases like this, as it always has actual SEO urls, even in such cases like you mention. So why should we add additional processing here - detecting object type, loading it etc?...

tjungcl

2011-09-26 16:16

reporter   ~0005267

yes i am, but didnt think of it that way.

When calling an expired url, i expected (from a visitors point of view) to be redirected to the new url, which doesnt happen on the first visit.

but i guess you are right on relying on the canonical url.