.htaccess rewrite to folder - apache

Is it possible to rewrite url to point to the "last" folder in directory?
Folder structure:
/path/to/site
/path/to/site/0.1.0
/path/to/site/0.2.0
/path/to/site/0.3.0
http://host/path/to/site/0.1.0 show content of folder /path/to/site/0.1.0
http://host/path/to/site/0.2.0 show content of folder /path/to/site/0.2.0
http://host/path/to/site/0.3.0 show content of folder /path/to/site/0.3.0
http://host/path/to/site shows content of folder /path/to/site/0.3.0

Related

Blazor Server-Side: Show file in razor page that is outside wwwroot folder

I have a PDF file in a folder called "UploadedFiles". This folder is not inside the wwwroot folder.
On the "showFile.razor" page I want to show this PDF.
How can I return the PDF file from UploadedFiles to showFile.razor
I used element on the showFile.razor page with the file in wwwroot and it worked, but the file is accessible for everyone when it is in wwwroot. This is not what I desire.

Do I have to move my Dropbox folder to work with JupyterLab?

The File menu in JupyterLab has few options for saving and opening files. The menu items do let one browse the file system and search for a directory. For example, the File->Open from Path... menu item only allows entering a file on a path relative to /jlab/root. Questions:
What is the location of /jlab/root. Is there a command that shows it?
I like to keep files with code in a subfolder of my Dropbox folder. What do I do if my Dropbox folder is not a subfolder of /jlab/root?

How to disable parent htaccess rules in a specific folder

I have an htaccess in the main folder. I don't want to apply the main htaccess to a specific folder inside the main folder.
--Main Folder
.htaccess
some folder
another folder --> don't want htaccess to apply here
some files
...
How can I do this?
Just create a one liner .htaccess in that specific folder where you don't want rules from main .htaccess to apply with:
RewriteEngine On

Apache directory root and public directory can't access to files

In my /var/www/ i have:
my_project
|-app
|-controllers
|-models
|-views
|-core
|-css
|-js
|-public
|-index.php
I have set up "DirectoryRoot" to:
/var/www/my_project/public/
Now when i open web page in browser my views are loaded but links to files in css and js folders don't work. It looks like I can't go one directory up. What am i doing wrong ?

Apache htaccess setting default index.html or <folder name>.html

We have an automated legacy system that provides zip files with html content (including images and other files). The system will either provide a folder with an index file or a file with the name as the folder.
For example say the file being sent in was User Supplies.zip
We would either see a folder structure like this
User Supplies/index.html
or like this
User Supplies/User Supplies.html
Currently we examine the contents for the zip file and rename anything that matches the folder name back to index.html. Since there could be other html files in there it has become a bit of spaghetti code to get it to work.
We could get rid of all this code if we can include something to the equivalent of "Use index.html or [folder name].html as the default file"