analyzethism1 Posted April 24, 2014 Share Posted April 24, 2014 (edited) Greetings, I'm am trying to achieve the desired results below with htaccess rewrite: First I want to turn away any traffic that is not from me on my development server and redirect it to my new server Then I want to redirect all traffic from sub.example.com to sub.example.com/index.php Now all traffic that is going to sub.example.com that is for a ".html" file should be directed to sub.example.com/index.php The traffic may contain multiple sub-directories that are important and refer to connecting "departments" so this information should be passed on to be processed. The page is also important because it determines which sub file to include. Also any additional gets and post should also be carried as well. Gets should be visible to the user Also I have a wordpress install on the same server I want all traffic that is going to example.com or www.example.com to be redirected to the wordpress file It should not appear that it is being redirected. I don't want the average joe to know that the backbone of the CMS is wordpress. Here is the basic layout of the file structure: root - sub - wordpress I assume I will require a htaccess file structure like this (maybe htaccess2 is not necessary): root > .htaccess1 - sub --> .htaccess2 - wordpress --> .htaccess3 htaccess1 ============================== <IfModule mod_rewrite.c> RewriteEngine On # UNDER DEV BYE RewriteCond %{REMOTE_ADDR} !^50\.137\.81\.108$ RewriteRule !^wp-admin/ www.currentsite.com/ [R=301,L] #RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ #RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301] #wordpress #RewriteRule ^www.example.com/index\.php$ - [L] #RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule . /index.php [L] </IfModule> htaccess2 ============================== <IfModule mod_rewrite.c> RewriteRule ^sub\.(.+)\.html$ /sub/index.php?request=%{REQUEST_URI} [NC,L,QSA] </IfModule> .htaccess3 ============================== # BEGIN WordPress <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com[nc] RewriteRule ^(/*)$ http://www.example.com/$1 [r=301,nc] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Now the problem is I can't get all the features I want working together. Sometimes I can get the sub.example.com working, however it behaves oddly. When a href is clicked it will go to that page but mask it as the previous page. But when a onclick parent location is clicked it works fine....odd? When I right click on some areas of the page (in sub.example.com) it shows a frame like is found in wordpress and when I view the source it is not correct. I have been caught in a loop of trial an error waiting for the light to come on. I would appreciate any assistance. Thank you, Edited April 24, 2014 by analyzethism1 Quote Link to comment https://forums.phpfreaks.com/topic/287990-multiple-parent-trees-subdomain-indexphp-and-a-little-wordpress/ Share on other sites More sharing options...
analyzethism1 Posted April 24, 2014 Author Share Posted April 24, 2014 Well... after a little more research I see that the masking frame thing maybe caused by GoDaddy masking feature on their VPS.... errr. Quote Link to comment https://forums.phpfreaks.com/topic/287990-multiple-parent-trees-subdomain-indexphp-and-a-little-wordpress/#findComment-1477172 Share on other sites More sharing options...
analyzethism1 Posted April 24, 2014 Author Share Posted April 24, 2014 Update: Turns out all my issues were caused from GoDaddy zone file issues. I added the domain through their nice "add sub domain" feature, Fixed issue by manually adding the domain in the zone file. Not an htaccess issue after all. Quote Link to comment https://forums.phpfreaks.com/topic/287990-multiple-parent-trees-subdomain-indexphp-and-a-little-wordpress/#findComment-1477177 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.