How can I convert all SEO urls to lowercase in Shopware 6? - shopware

I want to have only lowercase SEO URLs in my Shopware 6 shop. How can I achieve this in the Administration area of Shopware 6?

Add the lower filter from Twig to your variables in the Settings > SEO menu.
For example:
{{ product.productNumber }}
becomes
{{ product.productNumber|lower }}

Adding to the answer of Marcus:
after adding the |lower filter in the SEO settings, you need to re-build the URL indices which can also be done via the systems menu.
There might be cases where the URL is still using uppercase, this can happen if URLs where imported or changed after automatic generation.
You could use the SQL query
UPDATE seo_url SET seo_path_info = LOWER(seo_path_info);
once to make all existing SEO paths lowercase.
Use this at your own risk, as former existing links using upper-case might now cause 404 errors. So there is a chance that this might have a negative impact on SEO.

Related

Shopware SEO URL with product options names in it

I want to have my product urls like this:
bla.com/product_name_bla_white_140cm
white & 140cm are options I can select at the given product.
I thought I can set it via SEO URL template:
{{ product.translated.name}}{%for opt in product.options %}_{{opt.name}}{%endfor%}
but with this setting, the url is like: bla.com/detail/261927b50317410ba8eecc97d77c3b7e
what is wrong?
In \Shopware\Storefront\Framework\Seo\SeoUrlRoute\ProductPageSeoUrlRoute::prepareCriteria the association for options and options.group are not loaded, so you won't be able to access this data. The easiest way would be to add these criteria by plugin.

Rewrite condition to remove specific parameter in Prestashop

I have around 1000 categories created in prestashop and I have SPSEARCHPRO module installed. This module enables me to live search though my products.
Live search doesn't work due to the high number of categories but if I search normally it doesn't work either because the cat_id are included in the link and the link is too long. I suppose that's why the live search doesn't work either.
Here is what I'm trying to do:
I have this link:
https://example.com/en/module/spsearchpro/catesearch?fc=module&module=spsearchpro&controller=catesearch&orderby=name&orderway=desc&cat_id=2%2C4%2C(etc etc etc etc etc)
how can I remove the cat_id parameter from the link because the value is too long, it includes all the category id's.
I'm on prestashop 1.6.1.9 with multistore enabled (I don't know if that matters).
Putting this early in your .htaccess should cut out the unwanted parameter when the path ends with the category search slug, you may need to add other slugs to that if there are more affected pages.
RewriteCond %{QUERY_STRING} ^(.*?&)?cat_id=(?>[^&]*)(?:&(.*))?$
RewriteRule ^.*/catesearch$ /$0?%1%2 [NS,DPI,PT]
You may have to use L,R instead of DPI,PT flags if PrestaShop doesn't trust the $_GET it starts with (which comes from the rewritten URL). I'm unsure because it looks like it re-parses the URL from $_SERVER['REQUEST_URI'] which is unchanged by rewriting and would overwrite the corrected parameters with the original undesired ones. It may be the only way to make it work is an external redirect.

Notes 9, rewriting URLs

How do you rewrite a URL in Notes 9 XPages.
Let's say I have:
www.example.com/myapp.nsf/page-name
How do I get rid of that .nsf part:
www.example.com/page-name
I don't want to do lots of manual re-direct because my pages are dynamically formed like wordpress.
I've read this: http://www.ibm.com/developerworks/lotus/library/ls-Web_site_rules/
It does not address the issue.
If you use substitution rules like the following, you can get rid of the db.nsf part and call your XPages directly as example.com/xpage1.xsp:
Rule (substitution): /db.nsf/* -> /db.nsf/*
Rule (substitution): /* -> /db.nsf/*
However, you have to "manually" generate your URLs without the db.nsf part in e.g. menus because the XPages runtime will include the db.nsf part in the URLs if you use for instance the openPage simple action.
To completely control what is going in and out put your Domino behind an Apache HTTP and use mod_rewrite. On Domino 9.0 Windows you can use mod_domino
You can do it with a mix of subsitutions, "URL-pattern" and paritial refresh.
I had the same problem, my customers wants clean URLs for SEO.
My URLs now looks like these:
www.myserver.de/products/financesoftware/anyproduct
First i used one subsitution to cover the folder, database and xpage part of the URL.
My substitution: "/products" -> "/web/techdemo.nsf/product.xsp"
Problem with these is, any update on this site (with in redirect mode) and the user gets back the "dirty" URL.
I solved this with the use of paritial refreshes only.
Last but not least, i uses my own slash pattern at the end of the xpage call (.xsp)
In my case thats the "/financesoftware/anyproduct/" part.
I used facesContext.getExternalContext().getRequestPathInfo() to resolve that URL part.
Currently i used good old RegExp to get the slash separated parameters back out of the url, but i am investigating a REST solution at the moment.
I haven't actually done this, but just saw the option yesterday while looking for something else. In your Xpage, go to All Properties, and look at 'navigationRules' and 'pageBaseUrl'. I think you will find what you are looking for there.

CakePHP nice urls - how to prevent normal urls from working

I have a website that's written using CakePHP. I've added some rewrite rules in the .htacces file to change the default urls to different ones (instead of /controller1/action1/parameter I have /some-string-about-controller-and-action/parameter, for example).
The problem is that now both the normal url and the nice one are available, and google seems to be indexing both, which is a problem. I'd like to only keep the nice one, which is the proper way to handle this so that it affects the google results as little as possible?
I don't know why you don't want to use cakes own routing (if you are having trouble doing what you want, you can accomplish what you want with a custom route class), then make sure that you redirect all relevant URL's in your .htaccess file to the desired URL using a MOVED PERMANENTLY redirect.
This way google will index the target url instead of the one that is undesirable. You are right to take offense to this, double indexing is a great way to harm your SEO rankings.

How realize SEF pagination (Ditto) - MODx?

Is it possible realize SEF pagination on Ditto - MODx? How do it - in scripts / nginx configuration (or anyone know htaccess solution )
What means..
It's pages whith list of articles
/articles.php
/articles.php?start=10
....
So in result should be
/articles.php/start/10
or something like it
And realize correct redirect to SEF
I'm very grateful to you in advance.
If you're going to use Ditto, you won't be able to do this without modifying the snippet code to set up paging as you require.
However, I would argue that /articles.php/start/10 is no more search friendly than the original as both 'start' and '10' are in no way related to the content on those pages. Google and the other search engines are certainly capable of distinguishing between pages with different url parameters in this case, however if this remains an issue you might be better off exploring a different way to create your listings.
Have a look here for some useful insights:
http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
http://www.seomoz.org/blog/pagination-best-practices-for-seo-user-experience

Resources