I have a simple VueJS site that ive built and im deploying it to an apache server. I am having trouble with the .htaccess rewrite rules.
Right now it throws errors because index.html is looking for the files at the root(/) path instead of /v1/css or /v1/js. I want the url to NOT show the subdirectory, but to show as https://test.com. Then internally have the .htaccess point the /css, /js, /images, etc to /v1/css/, /v1/js/ etc...
apache server:
/
- v1
-.htaccess
---css
---js
---images
---index.html
---.htaccess
The .htaccess file in the root:
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule ^$ /v1/ [L]
The .htaccess in v1 directory:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
Basetag work for your? Try adding this to the header of your webpage<base href="/v1/">This will automatically correct your relative links location forexample:<img src="foo.jpg">will change its image path to<img src="/v1/foo.png">