Forum Moderators: phranque
Ever since we added the tolower code, Dreamweaver CS3 gives me the error 404 - testing service specified for this site does not map to the [localhost...] URL message. The testing server settings are correct because they worked until the tolower code was added and I havent changed any settings since then, and the php pages still work on the site, its just DW.
I'd tried the a-z 26 rule loop w/ htaccess, but it was way slower than rewrite map, and didn't quite cooperate with some of .cfm?x= rewrite rules for link on the old site.
Anyone have any ideas? either a way to force Dreamweaver to play nice with lowercase named /_mmserverscipts/mmhttpdb.php, or a way to tell rewrite map tolower to skip over /_mmServerScipts/ folder? I checked out the apache documentation, but it was too technical for me, I'm really just a photo/video/html guy in over his head - the most scripting I've had is a semester of JavaScript and the last 3 weeks straight on google for all this apache stuff lol
thanks
RewriteEngine On
# rewrite to force lowercase
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} !^/_mmServerScripts/
RewriteCond %{HTTP_HOST} ^(www\.)?(([^.]+\.)+([^.]+))
RewriteRule ^/([^A-Z]*[A-Z].*)$ [%2...] [R=301,L]
unfortunately I don't have direct access to httpd.conf and my host has been lagging lately as they are moving offices... so it will probably be a day or two until I actually get to test it out = (
Thanks Again!
You've got an opportunity to optimize the code by getting rid of an unneeded layer of parentheses/back-reference-creation, though:
RewriteCond %{HTTP_HOST} ^(www\.)?(([^.]+\.)+[b][^.]+[/b])
RewriteCond %{HTTP_HOST} ^(www\.)?(([^.]+\.)+[^.]+)[b]\.?(:[0-9]+)?$[/b]
If you don't properly handle the trailing period in this "www.example.com." FQDN example, then your rule won't be invoked because your existing RewriteCond pattern demands that additional non-period characters follow that final period. As a result, it would be easy to 'create' 404's on your site by linking to the FQDN with uppercase-containing URLs.
Jim