.htaccess or similar alternative...
- Started
- Last post
- 8 Responses
- gabe
i have a question and would very much appreciate your help.
i need to configure my web server to treat "splash.html" as the index file of the root directory. i know this is possible by simply adding one line to the .htaccess file. in fact, i already have that part of it working.
the problem however is that there is an index.php file that's under development that i'd like to be able to test. if this file is called anything other than "index.php", everything within the page breaks down (it's a word press site).
using .htaccess i can tell the web server to treat splash.html as the index page, thus if anyone does try and visit the site they don't see the wordpress site that's in progress. the problem occurs when i try and view the index.php page. instead of displaying the content of index.php and the wordpress site, it just loads the content of splash.html for some reason.
does anyone have any suggestions? thanks!
- utopian0
I just have been working on some redirects for an iPhone & iPad version websites, here is what I have been using:
---
RewriteEngine On
RewriteBase /RewriteCond %{HTTP_USER_AGENT} ^.*ipad.*$ [NC]
RewriteRule ^$ http://www.yourwebsite.com/ipad [R,L]
RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blaze... |maemo|midp|mmp|mobile|o2|opera\ mini|palm(\ os)?|plucker|pocket|pre\/|psp|sm... ce;\ (iemobile|ppc)|xiino [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1... wa|abac|ac(er|oo|s\-)|ai(ko|rn... |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl... u|g560|gene|gf\-5|g\-mo|go(\.w|o... i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i... |\-|\/)|ibro|idea|ig01|ikom|im1k... |\/)|klon|kpt\ |kwc\-|kyo(c|k)|le(no|xi)|lg(\ g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w... |o|v)|zz)|mt(50|p1|v\ )|mwbp|mywa|n10[0-2]|n20[2-3]|n3... )|sy(01|mb)|t2(18|50)|t6(00|10|1... )|webc|whit|wi(g\ |nc|nw)|wmlb|wonu|x700|xda(\-|2... [NC]
RewriteRule ^$ http://www.yourwebsite.com/mobil… [R,L]
- vaxorcist0
or you could tweek the index.php like this:
copy index.php to index2.php
then write a small index.php file like this:
<?php
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];// edit the URL below to whatever you want for your splash-index
if($pageURL !="http://www.me.com/mysite/"){
include("index2.php);
}else{
include("splash.php");
}
exit;
?>
- gabe0
thanks for the input vaxorcist, i'll give that a shot now
- vaxorcist0
you may have to do it with and without the www
tryprint $pageURL
to figure out what to expect....
- lukus_W0
Post your current .htaccess file in a pastebin.
- gabe0
problem resolved...thank you all very much for your help
- instrmntl0
post ur solution!