Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic subdomains + defined subdomains via htaccess
    primarykey
    data
    text
    <p>I hate asking questions about mod_rewrite, but I can't seem to get these rules working properly. I had it setup and figured out once before, but a few years have passed and now it's just not playing nice and my mod_rewrite knowledge is back to uhhhh......</p> <p>Essentially what I want to do is force www on the main domain, example.com. (or forcing no www would be even better, but I haven't remotely been able to get that working properly along with dynamic subdomains).</p> <p>If my.example.com rules exist, then follow them accordingly</p> <p>For anything else, ie: *.example.com, pass to another file to parse.</p> <p>The rules I have currently handles forcing the www, and properly handles the dynamic subdomain, but completely ignores my.example.com rules, handling it as a wildcard subdomain. It seems I can get any one of my rules working properly, but when trying to get them working together it's just being a bastard. If anyone knows have to get this working properly it would be super appreciated. </p> <pre><code>Options +FollowSymLinks RewriteEngine On RewriteBase / # force www on main, force no www would be better. RewriteCond %{HTTP_HOST} !^(.*)\.example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] # my.example.com defined subdomain RewriteCond %{HTTP_HOST} !^my\.example\.com$ [NC] RewriteRule ^.*$ - [S=3] RewriteRule ^$ /mydirectory/index.php [L] RewriteRule ^category/([^/]+)/?$ /mydirectory/index.php?category=$1 [L] RewriteRule ^submit/?$ /mydirectory/process.php [L] # *.example.com RewriteCond %{HTTP_HOST} ^(.*)\.com$ [NC] RewriteCond %1 !^(www)\.examples$ [NC] RewriteRule ^([^/]+)/?$ /subdomainparse/index.php?subdomain=%1&amp;fakedirectory=$1 [L] </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload