PHP_Idiot Posted March 11, 2010 Share Posted March 11, 2010 I know this is not anything to do with php, but I can't find any good forums for .htaccess files, and you guys are usually so knowledgeable that I figured some one is bound to know! I've had to rebuild my site, new templatte, new scripts basically everything. It's done and it works but now I need to redirect people from the old site to the new one. However, the new site is placed within a folder of the current site. My current index file is at www.gbpokerclub.co.uk/index.php but the new site folder and index is www.gbpokerclub.co.uk/beta2/index.php. I've googled the life out of it and come up with this: redirect 301 / http://www.gbpokerclub.co.uk/beta2/index.php which should act as a permanent redirect from the original site to the new one, but something weird is happening and when I upload the .htaccess file the url reads ttp://www.gbpokerclub.co.uk/beta2/index.phpbeta2/index.phpbeta2/index.phpbeta2/index.php and it just goes on and on repeating itself, and oviously causes an error. Anyone got any ideas? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/194921-can-anyone-help-me-with-htaccess-file-i-know-its-not-php-but-any-ideas/ Share on other sites More sharing options...
XeNoMoRpH1030 Posted March 11, 2010 Share Posted March 11, 2010 The .htaccess file is accessed like a hierarchy. If the root has a .htaccess, it will run that. If a subfolder does not, it will still run the root. I'm not sure if it will run both though if you go to the subfolder. Hopefully something like this will work so if it's the root, it will redirect to beta2: redirect 301 ^/$ beta2/index.php Not sure if it needs to be the full URL though as I can't say I've used redirect, only RewriteRule. Quote Link to comment https://forums.phpfreaks.com/topic/194921-can-anyone-help-me-with-htaccess-file-i-know-its-not-php-but-any-ideas/#findComment-1024847 Share on other sites More sharing options...
PHP_Idiot Posted March 11, 2010 Author Share Posted March 11, 2010 Your a hero Although your answer didn't work it did make me think about things slightly differently as I didn't understand the syntax you used. So I googled .htaccess syntax and stumbled across the answer: DirectoryIndex /beta2/index.php Woo hoo, thanks for trying to help Quote Link to comment https://forums.phpfreaks.com/topic/194921-can-anyone-help-me-with-htaccess-file-i-know-its-not-php-but-any-ideas/#findComment-1024866 Share on other sites More sharing options...
XeNoMoRpH1030 Posted March 11, 2010 Share Posted March 11, 2010 Glad you figured it out Quote Link to comment https://forums.phpfreaks.com/topic/194921-can-anyone-help-me-with-htaccess-file-i-know-its-not-php-but-any-ideas/#findComment-1024896 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.