Is it possible to mod_rewrite BASED on the existence of a file/directory and uniqueID? [closed]
- by JM4
My site currently forces all non www. pages to use www.
Ultimately, I am able to handle all unique subdomains and parse correctly but I am trying to achieve the following:
(ideally with mod_rewrite):
when a consumer visits www.site.com/john4, the server processes that request as:
www.site.com?Agent=john4
Our requirements are:
The URL should continue to show www.site.com/john4 even though it was redirected to www.site.com?index.php?Agent=john4
If a file (of any extension OR a directory) exists with the name, the entire process stops an it tries to pull that file instead:
for example: www.site.com/file would pull up (www.site.com/file.php if file.php existed on the server. www.site.com/pages would go to www.site.com/pages/index.php if the pages directory exists).
Thank you ahead of time. I am completely at a crapshot right now.