Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

I want to make my homepage /home

I have my index page as /home/index.php

How do I get the index page to automatically redirect from the top level URL without using header.

can I do something in .htaccess?

0
roscoeh23
Asked:
roscoeh23
  • 2
1 Solution
 
Steve BinkCommented:
If you redirect, don't you HAVE to use a header?  How else would you get the redirect command to the client?  Here's two methods:

1) (in PHP) header('location:new-location.php');
2) (in JS) window.location = 'new-location.php';

0
 
thebrainmanCommented:
you can also use this method if you would like to display something for a couple of seconds or not...  5 is the amount of time in seconds it will take before it forwards the user on...

<meta http-equiv="refresh" content="5;url=http://www.yourSite.com">

0
 
thebrainmanCommented:
You can also do this.. as routinet mentioned...

create a function in your header like this..
<html>
<head>
<script>
function pushUser(){
     window.location.href = '/home';
}
</script>
<head>
Then in  your body tag call the fucntion onload like this...

<body onLoad"pushUser();">



</body>
</html>
0
 
nplibCommented:
Inside you httpd.conf or whatever file you are using for site config
within the
<virtualhost *>
.....
Redirect /index.php htttp://www.yoursite.com/home
</virtualhost>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now