IIS URL Rewrite does not work on a complex URL

I have 2 URL redirection rules:

    <rewrite>
        <rules>
            <clear />
            <rule name="al - helyek/al (kieg)" enabled="true" stopProcessing="true">
                <match url="^test1/al/(.*)RootFolder=%2Ftest1(.*)" />
                <action type="Redirect" url="helyek/al/{R:1}RootFolder=%2Fhelyek{R:2}" />
            </rule>
            <rule name="al - helyek/al" enabled="true" stopProcessing="true">
                <match url="^test1/al/(.*)" />
                <action type="Redirect" url="helyek/al/{R:1}" />
            </rule>
        </rules>
    </rewrite>

But the first doesn’t work, only the second.

Test URL:
http://test:29001/test1/al/Megosztott%20dokumentumok/Forms/AllItems.aspx?RootFolder=%2Ftest1%2Fal%2FMegosztott%20dokumentumok%2FTeszt&FolderCTID=0x01200077BA4D1F1CDCF3498096871FD748FB37&View=%7B70C95A37%2D4FE1%2D4A60%2DA100%2D61E529A1DB56%7D

This is a SharePoint Site Collection.

What could be the problem?

Thank you in advance for your help.

nodes – How to embed image field url in API response?

I have a content type that has a title, body, link, and image field.
Then in my php file I have the following:

$articles = Drupal::entityTypeManager()->getStorage('node')->loadByProperties(('type' => 'expand_your_world', 'status' => 1));

When I check the articles variable in a JSON response, I only see the title, body, and link.

I then concluded that probably the reason why the image is not included, is because it is a reference field.

My get method looks like this:

$articles = Drupal::entityTypeManager()->getStorage('node')->loadByProperties(('type' => 'expand_your_world', 'status' => 1));

$main_content = ();

foreach($articles as $article) {
    $fields = (
        'title' => $article->title(0)->value,
        'body' => $article->body(0)->value,
        'field_expand_link' => $article->field_expand_link(0)->uri,
        'field_expand_icon' => '',
    );

    array_push($main_content, $fields);

}

$response = (
    'content' => $articles,
    
);

How do I embed the image URL in the response?

Woocommerce – identification of store with single delivery webhook url for multiple stores

I have multiple stores and a single web-hook delivery URL – so many stores all post their order updates and creations to the same URL.

In a typical scenario a delivery url would work with one store and so there would only be a singe known secret to try/use to verify and identify the request. But in my case with many stores posting to the delivery URL I don’t know which of the many secrets to try.

Is there a way to achieve this?

I want to replace an URL in Google Sheets as a personalized hyperlink in my Google Docs body

I have a link in one of the Google Sheets cells like this:

I know how to attach it to the Google Docs body through the following steps:

const body = doc.getBody();
body.replaceText('{{MyURL}}',row(number)

This gives me the result you can watch here:

but I would like to have this result instead:

So, how can I do this? Any help will be appreciated!

entities – How to I embed image field url in API response

I have a content type that has a title, body, link, and image field.
Then in my php file I have the following:

$articles = Drupal::entityTypeManager()->getStorage('node')->loadByProperties(('type' => 'expand_your_world', 'status' => 1));

When I check the articles variable in a JSON response, I only see the title, body, and link.

I then concluded that probably the reason why the image is not included, its because it is a reference field.

My get method looks like this:

$articles = Drupal::entityTypeManager()->getStorage('node')->loadByProperties(('type' => 'expand_your_world', 'status' => 1));

$main_content = ();

foreach($articles as $article) {
    $fields = (
        'title' => $article->title(0)->value,
        'body' => $article->body(0)->value,
        'field_expand_link' => $article->field_expand_link(0)->uri,
        'field_expand_icon' => '',
    );

    array_push($main_content, $fields);

}

$response = (
    'content' => $articles,
    
);

How do I embed the image URL in the response?

api – REST: How to “upsert” a resource without an specific resource URL

I’m trying to create a REST API that allows the user to:

  • create a resource if it doesn’t exist.
  • update a resource if it exists.

with the same request.

Given an example: I have a company that has many employees. I know that the way that usually an employee is inserted is using something like do a post request to /employees/ URL with a body that represents the employee to be created and as result, I will get similar content with a field that identifies the created resource. In most cases, if I try to insert another employee with data that conflicts with the first created employee, like the fiscal document code, I will get a 400 or 409 response that indicates a conflict with an existent resource. But if I want to create a permissive API that instead updates the present resource according to an attribute that I know that uniquely identifies the resource, what is the best approach?

  • A POST request means that the request is not idempotent, but an “upsert” request is idempotent. So I think that design the API using the POST method is not adequated.

  • A PUT request is idempotent but refers to a specific resource or a set of resources. Semantically, do a PUT /employees/ means that all existing employees are matched in this request.

  • Use something like PUT /employees/123, that 123 is an identifier of the employee is not possible when its identifier is synthetic and generated by the service. The user cannot know what identifier to use in this case.

Is possible to create a RESTful API that allows this kind of “upsert” request? If possible, how can I do?

8 – Get current url along with query string in content type node template file

I want to get complete url including query string in content type node template file

Suppose this the url example.com/abc?name=anc&contact=123456

Same I want to print in content type node twig file

I tried url and path but not print complete url inclucing query string

{{ url("<current>") }}   // example.com/abc
{{ path('<current>') }}  // example.com/

I print complete url example.com/abc?name=anc&contact=123456

Is there any theme hook that i can print the complete url

url rewriting – Redirect htaccess

I need to help with redirect my page.

For example I have websites https://example.com. I need to move content from https://example.com to https://example.com/blog. That is not problem and I do that with a change home_page URL. That work pretty well. But Now I need to add redirect from old https://example.com to https://xmpl.com.
I want to do with .htaccess but that does not work. Can you help me guys?

Here are some of my attempts of this but both does not work.

RewriteEngine On
RewriteRule https://example.com/ https://xmpl.com/ [L,R=302]

or

RewriteEngine On
Redirect 302 https://example.com/ https://xmpl.com/

Thank you for your help and time guys.