Forum Moderators: phranque
/page/view/thispage
/account/login
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomainhere.org
RewriteCond %{HTTP_HOST} ^(.+).mydomainhere.org/^(.+)
RewriteRule ^([^/]*)$ [mydomainhere.org...] [P,L]
ErrorDocument 404 /index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php
</IfModule>
$test = ''; //define the variable to please global vars off
$test = $_POST["namehere"];
echo $test;
ErrorDocument directive should be first or last in the file, not in the middle of the mod_rewrite code. IfModule tags. RewriteEngine On should appear only once. HTTP_HOST conditions, escape all the literal periods. [P] flag? RewriteBase / is the default and can be deleted. RewriteRule use a more exact pattern than (.*) then you can dump the -f and -d tests. Those are very inefficient. [L] flag.
I don't know what any of the flags do or indeed what most of the rule conditions mean... I spent ages trying to find code that worked for the first situation and eventualy found that online so just copied it straight from wherever I found it.