Here’s how to install YOURLS and WordPress both are in the same directory.
- Install WordPress
- https://www.bluehost.com/help/article/install-wordpress-manually
- Install YOURLS in the same directory with WordPress
- https://yourls.org/docs/guide/install
- Modify the
.htaccess
, see below
# BEGIN YOURLS and/or WordPress
RewriteEngine On
RewriteBase /
# Run index.php in the DocumentRoot
RewriteRule ^index\.php$ - [L]
# Add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
# Run any Physical File or Directory
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Run YOURLS
RewriteRule ^([0-9a-zA-Z-]+)\+?$ yourls-loader.php [L]
# Run WordPress (or index.php)
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END YOURLS and/or WordPress
[/php]
Source https://github.com/YOURLS/YOURLS/issues/2449