Rewriting URLs – Rewrite the question mark in the post template to get a nice URL

I hope you are all well and you are safe in these times.

I was wondering if anyone can help me remove the question mark (?) In the url.

The URL I want to rewrite looks like this: https://website.com/windows/post-name/?download

The url i want to have: https://website.com/windows/post-name/download

Please tell me what you think

.htaccess – Remove unwanted dots from the url and don't stop checking htaccess

I'm trying to remove unwanted dots from URLs like:
/en/example-.product

I would like to redirect this example link to:
/ en / sample product

We cannot delete dots right before file extensions like .png .jpg .css etc.

Dot appears randomly in the URL so it can be anywhere:

  • /en/example-.product
  • /en/example.-product
  • /de/ex.ample-product

My previous code – it breaks the page because points are removed from files.

RewriteEngine on
RewriteRule ^(.+).(.+) /$1$2 (R=301,L)

I also wonder how I can continue to check the URL as I will add some additional rules later, e.g. For example, removing "/ en /" from the URL or redirecting old, unused pages. I know I can't use the R or L flag – but when I try to use "N" it doesn't work. Here is my other part of .htaccess:

RewriteRule ^((A-z0-9-)+)/(d{1,2})$ /$1?page=$2 (R=301,L)
RewriteRule ^en/c/((A-z0-9-)+)/d{1,3}$ /$1 (R=301,L)
RewriteRule ^en/c/((A-z0-9-)+)/d{1,3}/(d{1,2})$ /$1?page=$2 (R=301,L)
RewriteRule ^((A-z0-9-)+)/(d{1,2})/(default|full)/(1-9)(/f_(A-Za-z)+_d{1,3}(_d{1,2})?/1)+/?$ /$1?page=$2 (R=301,L)
RewriteRule ^(en/c/)((A-z0-9-)+)/d{1,3}/(d{1,2})/(default|full)/(1-9)(/f_(A-Za-z)+_d{1,3}(_d{1,2})?/1)+/?$ /$2?page=$3 (R=301,L)
RewriteRule ^en/(.*)$ /$1 (L,R=301)

8 – Language code and country code on the URL

I tried to do this:

I have a multilingual site with 8 languages ​​(en, fr, es, de etc.) and I want to make all these languages ​​available for all countries.

I want Drupal to understand this:

  • / en CO alias of / en
  • / en-FR alias of / en
  • / es-US alias of / es
  • / es-AR alias of / es
  • / fr-CO alias of / fr
  • / de-US alias of / de

And so on … (you share exactly the same content)

Adding all of these custom languages ​​is easy, but I don't want to because more than 1600 combinations are possible.

Do you know if there is a way to do this programmatically or with a module?

I am currently looking for PathProcessor, but for now no result.

Any help would be appreciated.

Bitcoin core – blockchain receive recall API in the recall URL does not work

I want to accept payments using the Blockchain Receive Payments API
Use different users to get different address on Bitcoin, but Callback API doesn't work

https://blockchain.info/api/api_receive

&& also try to monitor addresses for payments received and spent but not working

My problem is that the callback is never called – can someone review my code and tell me where I have the problem?

I also try to create log but not called and checkbacl log api with not call to check.

please solved my problem 🙂

Create a Balance Update API using this create.php file

$url = "https://api.blockchain.info/v2/receive/balance_update";
    $secret = $address;
    $post_data = array(
        "key"           => $this->API_KEYCODE,
        "addr"          => $address,
        "callback"      => "https://my-server.com/callback.php?customer_id=".$user_id."&secret=".$secret,
        "onNotification"=> "KEEP",
        "op"            => "RECEIVE",
        "confs"         => $conf
    );

    Log::info('START SERVICE CALL :' . json_encode($url). " : ".json_encode($post_data));
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, count($post_data));
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER , array(
        "cache-control: no-cache",
        "content-type: text/plain",
    ));
    $ccc = curl_exec($ch);
    curl_close ($ch);

    Log::info('END SERVICE CALL :' . $ccc);
    $json = json_decode($ccc, true);
    return $json;

This API returns a successful response in index ID, address and callback URL

second file callback.php

Log::info('TEST : START (BLOCKCHAIN Callback)========================================');
    Log::info('GET : '.jsone_encode($request));
    Log::info('GET : '.jsone_encode($_GET));
    $res = 'Nothing';

    $out_address = $_GET('secret');
    $in_address = $_GET('address');
    $user_id = $_GET('customer_id');

    $transaction_hash = $_GET('transaction_hash');
    $confirmations = $_GET('confirmations');
    $value_in_satoshi = $_GET('value');
    $value_in_btc = $value_in_satoshi / 100000000;

    $status = true;

    if($status == true) {

                $res = "*ok*";
        } else {
            //Waiting for confirmations


            $res = "Waiting for confirmations";
        }
    }
    Log::info('RES : '.$res);
    Log::info('TEST : END (BLOCKCHAIN Callback)========================================');

Hooks – Drupal 8 language code and country code on the URL

I tried to do this:

I have a multilingual site with 8 languages ​​(en, fr, es, de etc.) and I want to make all these languages ​​available for all countries.

I want Drupal to understand this:

  • / en CO alias of / en
  • / en-FR alias of / en
  • / es-US alias of / es
  • / es-AR alias of / es
  • / fr-CO alias of / fr
  • / de-US alias of / de

And so on … (you share exactly the same content)

Adding all of these custom languages ​​is easy, but I don't want to because more than 1600 combinations are possible.

Do you know if there is a way to do this programmatically or with a module?

I am currently looking for PathProcessor, but for now no result.

Any help would be appreciated.

SharePoint 2016 – MySite upgrade from SharePoint 2013 – Wrong URL

I have upgraded from SharePoint 2010 to SharePoint 2013 to SharePoint 2016 for database attachments. I updated my site's host URL in SharePoint 2016 UPS My Site to the new site collection, but Newsfeed, Onedrive, and Sites still point to the SharePoint 2013 URL.

Example:

My SharePoint 2013 website URL: http://sharepoint2013.domain.com/mysite
URL of my SharePoint 2016 website: https://sharepoint2016.domain.com/mysite

Note: In SharePoint 2016, read permission for my website, I can add users, click OK, but in "No exact match was found. Click the items that have not been resolved for more options." Same behavior with the secondary owner under "Clean up my website".

I also display 0 person results in SharePoint 2016 in my employee directory.

Any ideas on what I missed after upgrading my sites in SharePoint 2016.

Reflected XSS in a JavaScript URL with blocked characters

I am new to web security and am practicing laboratories at the Portswigger Web Security Academy. In this exercise, https://portswigger.net/web-security/cross-site-scripting/contexts/lab-javascript-url-some-characters-blocked, we have to call the alarm function with 1337 as a parameter.

The solution given on the website is
https://your-lab-id.web-security-academy.net/post?postId=5&%27},x=x=%3E{throw/**/onerror=alert,1337},toString=x,window%2b%27%27,{x:%27

The decoded version for reference
https://your-lab-id.web-security-academy.net/post?postId=5&'},x=x=>{throw/**/onerror=alert,1337},toString=x,window+'',{x:'

As far as I know there is a javascript statement like
var a = "get_parms" and we try to break out of the string, close the block and run our own code.

x=x=>{throw/**/onerror=alert,1337} is the arrow function that Alert assigns as global error handler and Thorws 1337.

toString=x, window+'' assigns xString x and then forces a string conversion in the window.
Now I have two questions

  1. Why does that only work when I click on? back to blog Button, although the string conversion is forced in the window?
  2. What is the use of the bold characters in the URL?
    https://your-lab-id.web-security-academy.net/post?postId=5&& # 39;}, x = x => {throw / **** / onerror = alert, 1337}, toString = x, window + & # 39; & # 39 ;,{x: & # 39;

Thank you in advance.

Friendly URL with variable ID

I have the following code, but it doesn't work for me. It doesn't get me to the side that has to lead me. I pass the name of the game, although I would like to do it based on the ID and that it doesn't appear in the URL.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

RewriteBase /
RewriteRule ^g/(.*)$  game.php?name=$1

It changes the URL in the browser, but doesn't take me to the game.php page


8 – Data export views – Export the URL of a referenced media element

I need to export to CSV from a range of content. Each content uses a media field that I want to refer to. The rest of the fields are exported easily, but I can't export the media field as a URL to this image.

I tried the default route to create a relationship with this asset and use the file URL field to no avail. I even tried unsuccessfully to use the image url formatting field. Does anyone have any insight into this question before I go to the rabbit hole to create a custom module for a simple thing?