Search code examples
.htaccessurlmod-rewritefolderbrowserdialog

How do I write a URL where a folder does not exist, which will not make me change page


I want write an URL like this

http://my-site.it/Existingfolder/FolderNotExist

But I would that url will remain the same (with FolderNotExist) but continue to show this page

http://my-site.it/Existingfolder/

How can i do using .httaccess ?

Actually my Website in Joomla go to Error404 with http://my-site.it/Existingfolder/FolderNotExist


Solution

  • You can try this rule before default Joomla front controller rule:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.+?)/[^/]+/?$ $1/ [L]