Jump to content
thirty bees forum

Suggestion: Editing SEO>Friendly URL automatically creates a permanent redirect


30knees

Recommended Posts

I'd not recommend this as your database can quickly become massive. Magento 1 has this sort of thing in place and I've seen sites with over 20,000 records for re-directs in it as even slight changes to the url / structure creates new re-directs. You can end up in the situation with redirect -> redirect -> redirect ... etc in a long chain, which is very bad for Google. Best way to do it is 301 any that are linked to via .htaccess (if you can't get the original source changed) and re-submit the new url through Google Console. Try to get Google to re-index the new url, it usually sorts itself out within a month.

Most of your urls won't be linked to unless your site is very old so re-submitting through Google Console for the new url is a better method.

Link to comment
Share on other sites

@davidp I disagree. First of all, table with 20000 records is not a big table, especially when it contains 2 columns only (product id and original url / link rewrite).

This mechanism wouldn't have any negative performance impact on 'normal' page load, as it would be triggered only when product can't be found. Also, there can't be any redirect chain, only one redirect to current product url. Actually, we don't even have to do the redirect, we could simply render product page with canonical url meta tag in the header.

Link to comment
Share on other sites

See the issue with this becomes two-fold. The redirects for speed need to be in the htaccess file, up until a point. Say you have 100 redirects, htaccess is where they need to be, this will bypass the application totally and will be redirected on the server level, keeping things fast. But you hit a point, lets say 10k redirects, at that point they need to be in the database. Because loading the htaccess file is going to be time consuming and since it is really based off regex searches it will take even longer.

For the best speed, everything needs to be in the httpd.conf (if you are using apache) but we cannot write to that location. This is something I have done quite a bit of testing on in the past couple of years and there really is not a one size fit all solution.

Link to comment
Share on other sites

@lesley I think we are talking about two different things. I believe you are talking about changing schema or urls / routes under Preferences > SEO & URLs. I'm talking about changing link_rewrite on product page. I'm not sure which problem @30knees originally talked about....

Now, I also think it doesn't make any sense to automatically fix url when route schema changed. That would be crazy, and we would indeed have to use htaccess fille. Moreover, it's also not very important issue because no sane merchant will ever change routes on running shop with some history.

But they can, and often will, change friendly url on individual products. At the moment, when you change friendly url on product, any link to this product will stop working. For example, I've changed friendly url on Candle to candle-1 -- url changed to /en/gifts/candle-1, and original url /en/gifts/candle now returns 404. Prestashop doesn't have this problem because they rely on product id as a primary identifier in URL, so they can change friendly urls how many times they want.

It would be very easy to fix this issue. We just have to remember history of friendly urls for each product, and use this info when we can't find product. Performance impact is none for happy path, and only a single sql query for historical url. But added value is huge.

Link to comment
Share on other sites

@datakick We tried a few ways of saving the url history, that proved problematic, especially changing back and forth several times. The problems and use cases we could not over come were things like changing a product name to another name. Eg, changing /computer to /old-computer, then adding a new product called /computer that would crash the system. You end up reserving urls and need a method to dump them.

I am one of the people that thinks that there is very little value in the actual url, that changing them for the most part is pointless. I see what we rank for with thirty bees, half the keywords we rank for are not in the URLs.

Link to comment
Share on other sites

@lesley I don't think we have to complicate this by reserving urls, etc... the history log doesn't even have to be unique. Just find out which product used this link-rewrite last, and display that one. I'm sure this simple mechanism would display the 'right' product 95% of the time. I believe conflicts with link rewrite would rarely happen. And even when there's a conflict and we display different product than to which link originally point to, it's safe to assume this new product will be similar.

It's definitely much better than showing 404, that one only cause bounce.

Link to comment
Share on other sites

@datakick said in Suggestion: Editing SEO>Friendly URL automatically creates a permanent redirect:

@lesley I think we are talking about two different things. I believe you are talking about changing schema or urls / routes under Preferences > SEO & URLs. I'm talking about changing link_rewrite on product page. I'm not sure which problem @30knees originally talked about....

I am talking about your use case, @datakick. I edit the friendly URL on the product page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...