Page is a not externally linkable
HaloPlayer - 11:42 am on Nov 3, 2012 (gmt 0)
I finally got it to work! Thanks for the tips and patience g1smd, I really do appreciate it :-)
The final code, so other people can use if if they find they are in a similar situation to me, if you wouldn't mind checking it out, will this cause any unwanted side effects?:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{THE_REQUEST} name=([-a-z0-9_]+)
RewriteRule ^book\.php$ /book/%1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^book/([-a-z0-9_]+)(&|$) /book.php?name=$1 [L]
So in the end I replaced the %{QUERY_STRING} with %{THE_REQUEST}
I'm a little confused whether this is the appropriate fix though, becase a few of the examples used this as well:
%{THE_REQUEST} ^[A-Z]{3,9}
The {3,9} must have some significance because it is repeated in the examples.
And since I have replaced the %{QUERY_STRING}
with %{THE_REQUEST} haven't I made the query string condition redundnant?, yet it still works?
As silly as it sounds I see a lot of sites who use extensionless URL's still allow for a trailing / at the end of a URL as well as a URL without one, e.g. http://www.example.com/mypage also works: http://www.example.com/mypage/
The above code does not allow this, is it worth tweaking it to allow this?
Sorry for all the questions, I got a bit excited :-)