News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

how to redirect a page?

Started by peps1, January 28, 2015, 02:08:01 PM

Previous topic - Next topic

peps1

I recently had to move my form for my root into a folder on the root (due to file permissions, windows hoasting, godaddy bla bla bal)

So right now I just have a index page on the root with a hyper-link to the forum.

Is there a way to just set up a auto redirect, so anyone going to mydomain/index.html automatically get sent to mydomain/forum/index.php 

Kindred

Are you actually running SMF 2.1 beta1?

Your posts in the other boards suggest not....

there is a way... but it differs between windows and linux hosting...  so, which one are you actually running?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

peps1

sorry, yes I posted in totally the wrong place........its been a long day!

I'm on 2.0.9

I currently have a index.php with the following code, but not sure if this method has downsides as there seems to be 101 ways to do it, all with pros and cons, mainly SEO.

<?php
  header
('Location: http://mydomain/forum/'true301);
  exit();
?>

austin.bollinger

Quote from: peps1 on January 28, 2015, 02:23:06 PM
sorry, yes I posted in totally the wrong place........its been a long day!

I'm on 2.0.9

I currently have a index.php with the following code, but not sure if this method has downsides as there seems to be 101 ways to do it, all with pros and cons, mainly SEO.

<?php
  header
('Location: http://mydomain/forum/'true301);
  exit();
?>


Permanent redirect PHP, that is as good as it gets my friend. If it is working, all is well. You could also use .htaccess --- I'm a bit tipsy though. Just look up ".htaccess redirect"........ http://coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/ [nofollow]

Kindred

except htaccess mostly only works well on linnux and not well on windows... which is, again, why I asked....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

peps1


Kindred

in that case, your php redirect using the header is probably your best option...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Eh?

.htaccess works fine on any Apache server, regardless of operating system. But Windows hosting doesn't always use Apache... hard to know what's actually in use here. If it's Apache, .htaccess will work fine. If it's IIS, you will need to do it in PHP.

Kindred

Ah. Thanks for that clarification, Arantor...   you are indeed correct -- and I was assuming that windows server == IIS... which is potentially incorrect.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

austin.bollinger

This is also somewhat relevant: http://stackoverflow.com/questions/257936/htaccess-or-htpasswd-equivalent-on-iis [nofollow]

In case someone is running an IIS server and wants an .htaccess equivalent rewrite.

Advertisement: