magento2 – Containerized Magento 2 resulting in `Expecting a string, got NULL` error when trying to adjust URLs

When running Magento 2 in a multi-container docker compose setup, I’m receiving the following error:

1 exception(s):
Exception #0 (LaminasUriExceptionInvalidArgumentException): Expecting a string, got NULL

Exception #0 (LaminasUriExceptionInvalidArgumentException): Expecting a string, got NULL
<pre>#1 LaminasUriUri->parse(NULL) called at (vendor/magento/module-backend/App/Area/FrontNameResolver.php:140)
#2 MagentoBackendAppAreaFrontNameResolver->getHostWithPort(NULL) called at (vendor/magento/module-backend/App/Area/FrontNameResolver.php:129)
#3 MagentoBackendAppAreaFrontNameResolver->isHostBackend() called at (vendor/magento/module-backend/App/Area/FrontNameResolver.php:106)
#4 MagentoBackendAppAreaFrontNameResolver->getFrontName(true) called at (vendor/magento/framework/App/AreaList.php:76)
#5 MagentoFrameworkAppAreaList->getCodeByFrontName('home') called at (vendor/magento/framework/App/Http.php:111)
#6 MagentoFrameworkAppHttp->launch() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#7 MagentoFrameworkAppHttpInterceptor->___callParent('launch', array()) called at (vendor/magento/framework/Interception/Interceptor.php:138)
#8 MagentoFrameworkAppHttpInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#9 MagentoFrameworkAppHttpInterceptor->___callPlugins('launch', array(), array(array('Vaimo_RuntimeFla...', 'Vaimo_AjaxBlocks'))) called at (generated/code/Magento/Framework/App/Http/Interceptor.php:26)
#10 MagentoFrameworkAppHttpInterceptor->launch() called at (vendor/magento/framework/App/Bootstrap.php:261)
#11 MagentoFrameworkAppBootstrap->run(&MagentoFrameworkAppHttpInterceptor#0000000024ab3be90000000018e5fcf0#) called at (pub/index.php:40)
</pre>

I’m using a customized admin url and have modified the other urls as illustrated with the data from this query:

select * from core_config_data WHERE ( path LIKE '%admin/%url%') OR ( path LIKE 'web/%/%url%');

With the results being:

+-----------+---------+----------+---------------------------------------------------+----+-----------+---------+----------+---------------------------------------------------+-------------------------------------+---------------------+
| config_id | scope   | scope_id | path                                              | value                               | updated_at          |
+-----------+---------+----------+---------------------------------------------------+-------------------------------------+---------------------+
|         8 | default |        0 | web/unsecure/base_url                             | http://app.myURL.test            | 2021-06-08 20:24:18 |
|        11 | default |        0 | web/secure/base_url                               | https://app.myURL.test           | 2021-06-08 20:24:18 |
|       452 | default |        0 | web/canada_external_stores_config/canada_caen_url | https://myURL.ca/en/home/        | 2020-01-28 12:11:54 |
|       458 | default |        0 | web/canada_external_stores_config/canada_cafr_url | https://myURL.ca/fr/home/        | 2020-01-28 12:11:54 |
|       461 | default |        0 | web/unsecure/base_link_url                        | https://app.myURL.test           | 2021-06-08 20:24:18 |
|       464 | default |        0 | web/unsecure/base_static_url                      | NULL                             | 2020-01-28 12:11:54 |
|       467 | default |        0 | web/unsecure/base_media_url                       | NULL                             | 2020-01-28 12:11:54 |
|       470 | default |        0 | web/secure/base_link_url                          | https://app.myURL.test           | 2021-06-08 20:24:18 |
|       473 | default |        0 | web/secure/base_static_url                        | NULL                             | 2020-01-28 12:11:54 |
|       476 | default |        0 | web/secure/base_media_url                         | NULL                             | 2020-01-28 12:11:54 |
|      4451 | default |        0 | admin/url/use_custom                              | 1                                   | 2021-06-08 20:24:18 |
|      4454 | default |        0 | admin/url/use_custom_path                         | https://app.myURL.test/admin | 2021-06-08 20:24:20 |
+-----------+---------+----------+---------------------------------------------------+-------------------------------------+---------------------+

I’ve monkeyed with the base url in different configurations but no matter what I do, when I set the admin/url/use_custom_path and admin/url/use_custom I receive the above error. Can anyone point me to the next logical troubleshooting path?

I would like to split multiple URLs from a single Google Sheets cell and then add them as images into a Google Doc

First, you’ll want to prepare the cells in the results range to display the images. In the case of your post example and sample spreadsheet, right-click on the “2” to the left of Row 2, choose “Resize row” from the flyout menu, click the radio button by “Specify row height” and enter 58 for the value.

Once that is done, place the following formula in D2:

=ArrayFormula(HYPERLINK(SPLIT(REGEXREPLACE(A2,"(,).","$1"),",",0),IMAGE(SPLIT(REGEXREPLACE(A2,"(,).","$1"),",",0))))

This formula should produce the images for each of the five links while also retaining the hyperlink if you hover of each of the images.

If you will be trying to do this for multiple rows in A2:A, then do the following:

  1. Regular-click the “2” to select Row 2, scroll to the bottom of the sheet (or as far as you will want images), hold down SHIFT and click the bottom-most row number. This will select all of the rows in between.

  2. Right-click on the bottom-most row number and repeat the process described above for resizing the rows to 58.

  3. Insert the following version of the above formula in D2:

=ArrayFormula(IF(A2:A="",,HYPERLINK(SPLIT(REGEXREPLACE(A2:A,"(,).","$1"),",",0),IMAGE(SPLIT(REGEXREPLACE(A2:A,"(,).","$1"),",",0)))))

What’s better for SEO shorter URLs or more descriptive URLs?

We are planning our URL structure and currently deciding between two options:

https://contra.com/[short, non-descriptive namespace]/[uid]-[slug]

e.g. https://contra.com/o/RYlUgZeo-contra-landing-pages

and

https://contra.com/[descriptive namespace]/[uid]-[slug]

e.g. https://contra.com/work-opportunity/RYlUgZeo-contra-landing-pages

One of the URL design goals is to have uid as close to the root as possible. The reason is that such design ensures that whatever changes we make to URL schema, the original content can always be accessed, i.e. all of these URLs should access the same content

and redirect to whichever is the canonical URL.

The second goal is to make content title visible in the URL as early as possible. The ultimate goal is that results in Google should appear as:

enter image description here

Finally, the third option that we are considering is to make prefix part of the UID, i.e. The URL would become:

https://contra.com/oRYlUgZeo-contra-landing-pages

What URL schema design would get us closest to our design goals?

Manually constructing search URLs | NulledTeam UnderGround

There are occasions where it may be desirable to manually create a search URL.
Not me personally, but hey, everyone’s different (apart from genetically identical clones, obvs).

Although XF does provide the search parameters in the output URL when using the built in UI, which will generate a new search query if clicked, there are instances where there are no params and just an ID.
For example, searching for all posts by a specific member, or members, just produces…

.(tagsToTranslate)nulled(t)nulled sites(t)nulled forum(t)nulled script(t)nulled scripts(t)nulled script forum(t)best nulled scripts site(t)xenforo nulled(t)xenforo 2 nulled(t)xenforo nulled themes(t)seo xenforo 2(t)xenforo themes(t)seo for xenforo(t)vbulletin nulled(t)vbulletin 5 nulled(t)whmcs nulled(t)hexa whmcs(t)whmcs addons nulled(t)whmcs templates nulled(t)whmcs template nulled(t)whmcs modules nulled(t)whmcs themes nulled(t)cs-cart nulled(t)xfilesharing pro nulled(t)blesta nulled(t)arrowchat nulled(t)multi vendor ecommerce script nulled(t)seo providers(t)adsense alternative

networking – Why can’t HTTP URLs be resolved on my local network?

If I visit, for instance, http://tutor.com in any browser on my computer, I get a network timeout. But if I visit https://tutor.com it loads. This problem occurs with all devices on the network (Windows, Android, iOS, MacOS), for both wired and wireless connections, and is not specific to that site.

I don’t see how the protocol prefix would even matter for DNS resolution, and nslookup works just fine. But then why does the HTTP request time out? The normal behavior would be:

  1. tutor.com resolves to IP address
  2. http request returns a 301 redirect to https
  3. https request succeeds

Here is what happens using PowerShell:

Invoke-WebRequest http://tutor.com/
Invoke-WebRequest: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond..

Invoke-WebRequest https://tutor.com/

StatusCode        : 200
StatusDescription : OK
Content           : <!DOCTYPE html>
...

I know this works on other networks (my daughter took her computer to a relative’s house and it works fine there — redirecting and loading https://tutor.com).

In a browser, I can work around the problem by prefixing with https instead, but the problem is that the tutor.com application is requesting http URLs, which don’t work on my network. What could be causing this behavior, and how can I troubleshoot?

My O/S is Windows 10 20H2 19042.985. I have an ASUS RT-AC66U primary router and a tp-link AX6000 configured as an access point. I am using these OpenDNS IPs https://www.opendns.com/setupguide/#familyshield for DNS servers (I also tried configuring the router to connect to DNS server automatically but it made no difference).

Remove /category/ from category (archive) page URLs (without using a plugin)

A Category page URL structure looks like this:

example.com/category/cat/child_cat/

How can we do:

example.com/category/cat/child_cat/

Without the use of a plugin (eg, Yoast)?

How do I generate SEO-friendly GET URLs like RESTful API in GraphQL API?

I came from Restful API background. How do I generate google SEO-friendly GET URLs like RESTful API in GraphQL API?

reverse proxy – Why “/” nginx location rule fails to catch some URLs? Isn’t it supposed to go with all?

I have an nginx that serves as reverse proxy, and it redirects requests to an angular app or to a node js backend app depending on the request URL. There is also a rule location ~ /s/(cas)/(.*) that serves static content (although I’m seeing now that if “/” caught this route too, it would not be necessary to have that rule, as static content is also kept at backend:4000).

My concern is particular to the most general rule “/” that is supposed to catch all requests that did not fall into any other location, it is not applying correctly to some URLS causing nginx to send its 50x.html error page. In particular, my problem is that this redirection seems to not catch all traffic that didn’t fit a previous rule. And is the one rule in charge of redirecting the traffic that should land on the angular app.

If I’m correct, this should fall under the “/” rule:

https://SUBDOMAIN.DOMAIN.es/user/trip/13925/instant?sharedToken=(REDACTED)

And these should at least be redirected correctly by the “/” rule, but also show the nginx fail page after a lot of timeout:

https://SUBDOMAIN.DOMAIN.es/user/trip/foo/instant?sharedToken=(REDACTED) # changed id for "foo"
https://SUBDOMAIN.DOMAIN.es/user/trip/instant?sharedToken=(REDACTED) # removed id segment of url
https://SUBDOMAIN.DOMAIN.es/user/instant?sharedToken=(REDACTED) # also removed "trip" segment of url

Any other variation of the url works fine and is redirected to https://backend:4000.

So, why aren’t these rules caught by the location “/”?

This is the nginx config file. Domain and subdomain have been omitted on purpose:

server {
    listen 443 ssl http2;
    listen (::):443 ssl http2;
    expires $expires;
    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
    server_name (SUBDOMAIN).(DOMAIN_NAME).es;
    ssl_certificate /etc/nginx/ssl/CERT.crt;
    ssl_certificate_key /etc/nginx/ssl/CERT.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_session_cache shared:SSL:5m;
    ssl_session_timeout 1h;
    gzip on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_min_length 256;
    gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;

    location ~ /api(?<url>/.*)  {
        resolver 127.0.0.11;
        set $target http://backend:5000/api${url}$is_args$args;
        proxy_set_header X-Forwarded-Host $host;     # Relay whatever hostname was received
        proxy_set_header X-Forwarded-Proto $scheme;  # Relay either http or https
        proxy_set_header X-Forwarded-Server $host;   # Relay whatever hostname was received
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Prefix /api/;
        proxy_set_header Host "SUBDOMAIN.DOMAIN.es";

        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Expose-Headers Content-Length;
        add_header Access-Control-Allow-Headers Range;

    ## Websockets support 2/2
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    ## END Websockets support 2/2

        proxy_pass $target;
        client_max_body_size 10M;
    }

    location ^~ /_assets/ {
        alias /usr/share/nginx/html/assets/;
    }

    location ^~ /.well-known/acme-challenge/ {
        alias /usr/share/nginx/html/.well-known/acme-challenge/;
    }

    location ~ /s/(cas)/(.*) {
        add_header Pragma "no-cache";
        add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
        proxy_pass http://backend:4000;
    }

    location / {
        #root /usr/share/nginx/html;
        proxy_pass http://backend:4000;
        expires -1;
        proxy_set_header X-Forwarded-Host "SUBDOMAIN.DOMAIN.es";
        proxy_set_header X-Forwarded-Server "SUBDOMAIN.DOMAIN.es";
        proxy_set_header Host "SUBDOMAIN.DOMAIN.es";

        add_header Pragma "no-cache";
        add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";

        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Expose-Headers Content-Length;
        add_header Access-Control-Allow-Headers Range;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}

apache – Do short URLs obligate 301 redirects?

Redirects are for when you change URLs. If your site has short URLs from the very beginning, then you don’t need to implement redirects with your short URLs. You only need to implement redirects to your short URLs if you had long URLs before.

Using short URLs usually involves some sort of rewrite directive in your .htaccess file. These rewrites usually implement a front controller pattern to allow your content management system to handle all the URLs and put content on the short URLs. These rewrites are not 301 redirects. They are sometimes called internal redirects because they reroute URLs to a handler internally without changing the URLs that’s visible to visitors.

apache – Do short URLs must 301 redirects?

Some content management systems such as WordPress and Drupal have Short URLs by default (if the webserver allows it), but at least one other — MediaWiki, doesn’t.

Before I continue with the process of trying to make my MediaWiki website to include short URLs I’d like to ask a general understanding question on the subject (because I find the MediaWiki documentation about this extremely unorganized and undidactic).

Do short URLs must 301 redirects?
I do understand that they always require some webserver directives but I’m just not sure if such directives must include 301 redirects or not…