I have my dev site running in a sub-directory and I do have RewriteBase configured in the .htaccess to point to that sub-directory. However, links within site pages that go to things like "/some/thing.html" end up not working because they go to localhost/some/thing.html instead of localhost/backdrop/some/thing.html.

Is this the expected behavior? 

Comments

It's a very long time since I did development like that - most of my development is in Lando so I get a different base URL for each site.

Two thoughts come to mind:

  1. Have you set the base URL for the site in settings.php? That may help in defining the site root.
  2. Are you actually trying to link to an HTML page within your site root? It might be that you'll actually need a specific rule for that page within your .htaccess

@yorkshirepudding -

Thank you for your thoughts on this. 

  1. I had not set the base URL for the site, but tried it after seeing your post. It does not fix the issue, unfortunately.
  2. There are a great many such links to URL aliases in the site. 
  3. It also happens with inline images. And if I embed them in the dev site, then I get an extra "backdrop/" in the path and it doesn't work in the real site. 

It sounds like the RewriteBase and/or $base_url settings don't actually help this type of situation. Is their purpose only to send requests to the proper index.php?

Hopefully someone else with a bit more knowledge in the intricate workings here can help as I've reached the end of my ideas for things to try and don't have any way to test locally.

Sorry I can't be of any more help.