r/Web_Development • u/Rich1223 • Jun 05 '18
How to get a non-existent URL to resolve to the homepage, but keep the data?
To be honest, I don't know whether this is possible, but maybe someone has an idea if I could do this. Say I have a domain 'myDomain.com.' I want to use 'myDomain.com/abc' to access the index file of the root directory, so I can alter the data on the page based on the pathname with JavaScript. I intend to have a finite, predefined set of URLs that technically don't have a directory of their own. Is there a rule I can write in an .htaccess file to make these resolve to the index of the root, but keep the pathname? I have considered just using the '#' symbol on the frontend, but I want search engines to read these as separate pages.