Jump to content

can anyone help me with .htaccess file? (I know it's not php but any ideas?)


Recommended Posts

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

 

 

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.

 

Your a hero  :D

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.