Hi All,
Over the years I have smashed through God knows how many brick walls with .htaccess
, and all I've learnt is don't even try to make it complicated as nothing is ever simple. I have therefore resorted in recent applications to using mysite.com/index.php/category/sub-category/create/
etc. and PHP to get hold of the values. But this is avoiding a problem rather than solving it.
For instance, the URL I am looking at now is: daniweb.com/web-development/php/17/contribute
.
How would I go about making this in .htaccess
(or moreso how has Dani done it aha).
I normally use this sort of setup:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)/(.+)/(.+)/(.+)$ index.php?cat=$1&subcat=$2&catid=$3&task=$4 [QSA,L]
But it often plays havoc with stylesheets/PHP etc..
Is there a better way to accomplish a URL structure as complex as this? What sort of .htaccess
file does DaniWeb use to support it's huge and complex URL system?
Thanks for the advice