Page is a not externally linkable
jasimon9 - 7:04 pm on Jan 21, 2013 (gmt 0)
After making the changes described in my previous post, the page still gave an error. I jumped to the conclusion that it was still looping. However, this is apparently not always the case. Instead there is a problem with the rewriting, but no looping, as you can see from the following log entries:
192.168.1.205 - - [21/Jan/2013:12:38:44 --0600] [192.168.1.106/sid#698560][rid#73ca98/initial] (2) [perdir F:/Websites/RepHunter/current/] rewrite 'register.php' -> '/manufacturers-sales-reps-register.php?'
192.168.1.205 - - [21/Jan/2013:12:38:44 --0600] [192.168.1.106/sid#698560][rid#73ca98/initial] (2) [perdir F:/Websites/RepHunter/current/] explicitly forcing redirect with http://192.168.1.106:8080/manufacturers-sales-reps-register.php
192.168.1.205 - - [21/Jan/2013:12:38:44 --0600] [192.168.1.106/sid#698560][rid#73ca98/initial] (1) [perdir F:/Websites/RepHunter/current/] escaping http://192.168.1.106:8080/manufacturers-sales-reps-register.php for redirect
192.168.1.205 - - [21/Jan/2013:12:38:44 --0600] [192.168.1.106/sid#698560][rid#73ca98/initial] (1) [perdir F:/Websites/RepHunter/current/] redirect to http://192.168.1.106:8080/manufacturers-sales-reps-register.php [REDIRECT/301]
192.168.1.205 - - [21/Jan/2013:12:38:44 --0600] [192.168.1.106/sid#698560][rid#73ca98/initial] (1) [perdir F:/Websites/RepHunter/current/] pass through F:/Websites/RepHunter/current/manufacturers-sales-reps-register.php
192.168.1.205 - - [21/Jan/2013:12:38:44 --0600] [192.168.1.106/sid#698560][rid#73f400/initial/redir#1] (1) [perdir F:/Websites/RepHunter/current/] pass through F:/Websites/RepHunter/current/error404.php
Again, here are the rules now in effect copied from httpd-vhosts.conf:
RewriteCond %{THE_REQUEST} [A-Z]{3,9}\ /register\.php\?mode=create&usertype=pri\ HTTP
RewriteRule ^register\.php$ /manufacturers-sales-reps-register.php? [NC,L,R=301]
RewriteRule ^/manufacturers-sales-reps-register\.php http://www.example.com/register.php?mode=create&usertype=pri [L]
As you can see from the log entries, the final rewrite is not resolving to the page, and the error page is shown.
As a test, I removed the leading slash on the second rewrite rule. After doing do, the loop is produced. Putting the slash back in gets rid of the loop, but still results in the 404 error. So it seems that the leading slash in the pattern of the second rewrite rule is critical on the Windows instance but not on FreeBSD or Mac.
However, I tested with the revised rules on the Mac and FreeBSD instances, and now all of them produce the 404 error on trying to find manufacturers-sales-reps.php. So at least we are consistent with the same failure on all three platforms. There must be something simple that I am missing.