My .htaccess works (not an expert, but do a lot of copy & paste).
A typical rewrite for one of my pages looks like this:
RewriteRule ^my-grills-parts-and-service/?$ parts-service.php [NC,L]
...where the url "http://www.mydomain.com/my-grills-parts-and-service/" will invoke the parts-service.php file.
However, I am using php to construct a fully qualified URL, from what is in the address bar. The problem is, the server variable $_SERVER['SCRIPT_NAME'] will return "parts-service.php", rather than what is actually in the address bar, "my-grills-parts-and-service/".
I want php to somehow read the literal rewrite string, rather than the actual filename.
So, I want php to construct a string like this:
$url = "http://www.mydomain.com/my-grills-parts-and-service/";
I hope I don't have to write a data table or switch
or if
block, because that would be doing everything twice (once in the .htaccess, and again in a php file).