I am working on a projet and we have a folder “test” which hosts the whole page.
I want to have it, that it can be accessed by domain.com instead of domain.com/test
Normally I would just have the domain use test as a root folder but the cms wrote all images in the documents to domain.com/test but of course, if test is the root the images at domain.com/test (= test/test) can not be found. How can I fix this without editing all the images?
Can I just specify via htaccess that domain.com/test is supposed to look inside domain.com?
Thanks
// Edit: Solution
Thanks to the help I got the solution now my code is the following.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/test/.*$
RewriteRule ^(.*)$ /test/$1 [L]
Thanks again, you saved my day.
Should do it (not tested!). The first rule checks whether the /test/ folder is already accessed, and if so it skips the second rule. The second rule rewrites every URI to add /test/ before it.