I want:
sub.domain.comto loadindex.phpsub.domain.com?s=customto load/custom/index.php
I’m doing this right now:
In .htaccess:
RewriteRule ^(custom)/?$ index.php?subject=$1
and in index.php I have this:
if($_GET['s'] == 'custom') {
header( 'Location: http://sub.domain.com/custom/index.php' ) ;
}
… but is it possible to do the redirect via htaccess itself depending on the GET variable?
Thanks!
Yes, you could check query string with RewriteCond
With this, it redirects all requests with existing “custom” get parameter to index.php, and this can be extended 🙂
Idea: http://statichtml.com/2010/mod-rewrite-baseon-on-query-string.html