Page is a not externally linkable
cmnetworx - 9:25 am on Nov 25, 2010 (gmt 0)
I am trying very hard to understand how to properly use .htaccess files, and I have got most of it working, but I am stuck..
I am getting stuck particularly at the rewriting of the /companies part, The url would be something like /companies/?list=this and on the server side I want it to go to index.php?cat=this
However I know that my other rule
is working against it, but I don't know how to fix it, or how to get the RewriteRule ^([0-9]+)/?$ index.php?cid=$1 [L] RewriteRule ^companies/\?list=([A-Za-z_]+)?$ index.php?cat=$1 [L]
part to work with it.. Or if I even have that part working yet (haven't been able to test it yet)
Options +FollowSymLinks
RewriteEngine On
ErrorDocument 404 /404.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/?$ index.php?cid=$1 [L]
RewriteRule ^companies/\?list=([A-Za-z_]+)?$ index.php?cat=$1 [L]
RewriteRule ^([A-Za-z_]+)/?$ index.php?cat=$1 [L]
Open to any suggestions/help.
Also, I thought the "RewriteCond %{REQUEST_FILENAME} !-d" part would skip the rewrite if the directory actually exists. Did I do this wrong?