I am setting up a mobile version of a website. For technical reasons, it needs to be created on a subdomain, mobile.exampledomain.com. However, its content needs to also show up when going to exampledomain.com/mobile/ , and exampledomain.com/mobile/examplefile.html should show mobile.exampledomain.com/examplefile.html . The important point here is that doing a 301 redirect is not wanted, the URL in the browser window needs to remain the /mobile/ directory. Is this possible? If so, can anyone show me some example code?
Set sub-domain root to be the file which points to "/mobile" Like if following is cPanel path, ROOT: /home/example/www Mobile: /home/example/www/mobile set root of mobile.example.com to be /home/example/www/mobile This way, you will be able to access the files both the ways.
Thanks mastermunj, but the site is hosted on a Plesk server, not cPanel. When you create a subdomain in Plesk, it forces it to use another directory which is not under the root path for the main website. Is there are way I can achieve this using code in .htaccess alone?