Greetings, I have been researching the best way to do this with .htaccess. I have an entire wordpress install in the root directory, and would like to temporarily forward everything to: samewebsite.com/index.html index.html is a temporary page, and already comes up automatically before wordpress's index.php. But, Google has indexed some content already and I wish to forward the visitors arriving via deep links to the temporary page. Current contents of .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Code (markup): Thanks, - CC
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule> Change it to that
Probably RewriteCond %{REQUEST_URI} !/index.html$ RewriteRule $ /index.html [R=302,L] Code (markup): (And comment out everything under rewritebase with #) (untested)
I appreciate the responses. I will test them out shortly and let everyone know what worked. Thanx -cc
Both work in forwarding to website.com/index.html. Thank you both so much. The differences . . . Will keep any requested URL intact to the viewer, while actually displaying: website.com/index.html's content. (Extra points for sneakiness ) Will display the content and forward the URL that is visible to the person to: website.com/index.html. I'm even able to use an image from the same site in its index.html. I didn't think that would be possible with the Rewrite.
Yes, these two lines make sure that images and files will still work: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Code (markup): But I would still redirect to index.html though. Probably better for google if it gets a header 302 response instead of a content overwrite.
Hmm, well I checked today and the image in index.html on the same site was not showing, so I simply hosted it elsewhere for the time being.
Well, that is not very good idea because thus duplicate content is created (different pages with the same content) and the chance for pages to become supplemental is big.