Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

301 Redirects Don't Work On Non-Seo Url's Rate Topic   - - - - -

 
  • senadh
  • Member
  • Members
  • Join Date: 28-May 15
  • 16 posts

Posted 12 June 2015 - 01:01 PM #1

I have an issue with 301 Redirect feature on new installation of current version CS-Cart - 4.3.1

I can't get any custom URL's from previous, old store which were non-seo friendly, like for example:

mysite/index.php?dispatch=categories.view&category_id=192

to be redirected to :

mysite/dancing-shoes

I have imported all the products and categories with SEO add-on enabled, and all the redirects were automatically created. Most of all redirects are actually pointing to itself, with the exception of few cases where I actually changed the category name or hierarchy / structure.

The mod_rewrite is enabled and functioning, the redirects actually happen if I type the previous version of the category name (but only as SEO enabled URL).

If I copy and paste in browser - mysite/shoes/dancing-shoes
it will get redirected to - mysite/dancing-shoes
without any problems, which means mod_rewrite is working

However, if I type mysite/index.php?dispatch=categories.view&category_id=192
which is the original URL for mysite/shoes/dancing-shoes
I get 404 page not found
even after I have created a new redirect from this URL

The old (non SEO URL's) are indexed by Google, and every single one of them is coming up as 404 error.

Does anyone know how to fix this problem? Has anyone tried to redirect non SEO URL's in CS-Cart ?
Any help will be appreciated.

 
  • senadh
  • Member
  • Members
  • Join Date: 28-May 15
  • 16 posts

Posted 12 June 2015 - 02:11 PM #2

Correction!!!

It seems that mod_rewrite is not enabled on server after all. I will contact the web hosting to clarify this first, then post an update.

Sorry.

 

Posted 12 June 2015 - 06:54 PM #3

hi,

you are on the right direction - it should be about mod_rewrite.

best regards,
WSA team

 
  • senadh
  • Member
  • Members
  • Join Date: 28-May 15
  • 16 posts

Posted 13 June 2015 - 12:55 AM #4

Back to the square one - there is a problem related to CS-Cart and perhaps htaccess file settings, as I have just tested "mod_rewrite" separately and it is installed and working.

What I have done is this:

- created a subfolder within root directory called "rewrite_test"
- created an htaccess file with following:
RewriteEngine On
RewriteRule ^google.html$ http://www.google.com/ [R=301]
- loaded up mysite/rewrite_test/google.html in browser, and it det redirected to normal Google page.

So somethiong is wrong, I don't know what or where to look for it.
Please help, point me to where to look for solution.

Correction!!!

It seems that mod_rewrite is not enabled on server after all. I will contact the web hosting to clarify this first, then post an update.

Sorry.



 
  • senadh
  • Member
  • Members
  • Join Date: 28-May 15
  • 16 posts

Posted 13 June 2015 - 10:14 AM #5

AN UPDATE!

I was able to establish that mod_rewrite is working without any doubt, so problem is elswhere.

There were lots of 301 redirects automatically created by SEO add-on, and they were all correct and working fine. I have changed few categories (some have been moved to the root, others have name changed) and all products affected have 301 redirects cretaed by add-on.

I was also able to create redirects manually, pointing one category to another, or even creating a redirect for fake URL and pointing to actiual category - like "/how-to-make-pancakes" is succesfully redirecting to actual category on website.

So, the mod_rewrite is working.

Where I am stuck and getting nowhere is when I try to redirect an old (non-SEO) URL such as:
/index.php?dispatch=categories.view&category_id=192
to the new URL which is now
mysite/some-category
- it doesn't work!!!

The redirect is being created and I can see it added to the list, but when I test the old URL I still get 404 error.

I have tried putting in the old URL path without "index.php?" - like this:
/dispatch=categories.view&category_id=192
and redirecting it to the new URL, and it worked. If I try to access the full URL in browser
- mysite/dispatch=categories.view&category_id=192
it gets redirected to the new URL

Why it doesn't work when "index.php?" is included, I simply don't know.

Perhaps there is a bug in SEO add-on that needs to be fixed, or I am missing something. It could be that somewhere within rewrite conditions and rewrite rules something is not addressed as it should be.

The htaccess part looks like this:

<IfModule mod_rewrite.c>
RewriteEngine on
# Please note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.
# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
RewriteBase /
Options -MultiViews

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_URI} ^api/(.*)$ [or]
RewriteCond %{REQUEST_URI} .*/api/(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*api/(.*)$ api.php?_d=$1 [L,QSA]

RewriteCond %{REQUEST_URI} \.(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff|yml|xml)$ [or]
RewriteCond %{REQUEST_URI} store_closed.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)\/(.*)$ $2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,QSA]

</IfModule>


Any ideas? Anyone?
Do you think I should approach CS-Cart support team and submit a ticket?

Thanks in advance

 
  • breezee
  • Junior Member
  • Members
  • Join Date: 15-Jan 10
  • 60 posts

Posted 11 June 2018 - 01:34 PM #6

I have tried putting in the old URL path without "index.php?" - like this:
/dispatch=categories.view&category_id=192
and redirecting it to the new URL, and it worked. If I try to access the full URL in browser
- mysite/dispatch=categories.view&category_id=192
it gets redirected to the new URL

Why it doesn't work when "index.php?" is included, I simply don't know.

Perhaps there is a bug in SEO add-on that needs to be fixed, or I am missing something. It could be that somewhere within rewrite conditions and rewrite rules something is not addressed as it should be.

 

 

The same problem. How to make redirect with non-SEO url like:

/index.php?dispatch=aff_banners.view&bid=1&sl=EN&aff_id=5

It works great without index.php?, but doesn't when index.php? included.