Skip to content
Jose Maria Valera Reales edited this page Apr 17, 2023 · 4 revisions

Welcome to the lnaddress wiki!

Checkout the pages on the right to address your questions. Feel free to open an issue if you found a problem or -even better-, submit your PRs directly to the project with your ideas and improvements.

Prerequisite

  • Web server with PHP backend
  • LNbits Lightning implementation backend
  • Please note that LNbits doesn't need to be on the same server
  • You can use https://legend.lnbits.com/ for testing purpose
  • Web server must be able to be configured
    • to rewrite URL requests
    • OR
    • to let the PHP backend handle specific file(s) that don't have a .php extension

Configure web server to rewrite URL

Nginx

Nginx configuration

location /.well-known/lnurlp {
    rewrite ^/.well-known/lnurlp/(.*)$ /.well-known/lnurlp/$1.php last;
}

Apache

Apache configuration

You need to put a .htaccess file in the .well-known/lnurlp/ of your web root directory with the following content

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L]

Please note that .htaccess file will not be read if the Apache configuration doesn't allow configuration overriding, please see Apache documentation regarding AllowOverride directive.