Subdomain error 500

The forum restricts URLs which makes it virtually impossible to type a description of a problem with URL software. So here’s an image.

What am I doing wrong please?

Hello!
Can you use docker for this domain?

No

(blah blah extra stuff to make 20 characters in my reply)

Hello @exekutive, thanks for your message.

Try to change:

RewriteBase /u/

to

RewriteBase /

(Also better to remove YOURLS part at root.)

OK so I completely removed the .htaccess file from root.

and I made the changes to the .htaccess file in the yourls dir “u” as you suggested. (I didn’t type that there. It was generated automatically).
Now it has:

Options -Indexes

# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /u/yourls-loader.php [L]
</IfModule>
# END YOURLS

No change. Still Error 500.

If anybody wants, I can provide an FTP and yourls account on the server, via PM.

Where does your u domain point?
Which folder is the root for u.domain.com?

It’s in my firs post. u.domain.org points to root/u

Ah, indeed (but posting it as image is not the easier to be read :wink:).

Change also the following:

RewriteRule ^.*$ /u/yourls-loader.php [L]

to

RewriteRule ^.*$ /yourls-loader.php [L]

You need to configure it as it was root.
Then just follow the documentation. https://github.com/YOURLS/YOURLS/wiki/.htaccess#case-yourls-installed-on-root

(the image can be clicked on and enlarged)

Ah! I understand now.

Even though I have yourls installed in a subdirectory, my .htaccess file should be entered as if it was root, because I have set up the subdomain to point to the subdirectory.

I made the change, and the subdomain works, but now I can’t use the regular domain.
visiting domain.org/u/shortlink now gives me an error404. Is there any way to make yourls work with the domain AND subdomain?

It might be possible with apache config expert tweaking, but I won’t recommend doing it, especially if you’re not very confident with .htaccess files.

1 Like

Fair enough. Thanks for your help! :slightly_smiling_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.