Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

How to redirect url.com to url.com/home

I believe there is a way to do this because I have done this before, but forgot the code. I would really appreciate this. Thanks.

I think I need like a htaccess file?
Rename your home directory to index.php or index.html, I think haha
Edit ".htaccess"
Input: "DirectoryIndex /home"
Done.
Index.php:
<?php headers("Location: /home"); ?>
Who has time for a signature?
in my public_html i have 0 files. but if i go to public_html/ home, my website is in there.

so if someone goes to my website ( url.com ) they will get a blank page, unless they type url.com/home

so how can i fix that?
(Jan 10, 2016 02:05 PM)Underworldproblem Wrote:  in my public_html i have 0 files. but if i go to public_html/ home, my website is in there.

so if someone goes to my website ( url.com ) they will get a blank page, unless they type url.com/home

so how can i fix that?

I gave you the solution already.
Place a .htaccess file in your main directory with the contents.
htaccess

Code
Options +FollowSymLinks
  RewriteEngine On

  RewriteCond %{SCRIPT_FILENAME} !-d
  RewriteCond %{SCRIPT_FILENAME} !-f

  RewriteRule ^.*$ ./index.php

Thats what i use for my website, but i think you can use:
Code
DirectoryIndex /home
(Jan 10, 2016 02:05 PM)Underworldproblem Wrote:  in my public_html i have 0 files. but if i go to public_html/ home, my website is in there.

so if someone goes to my website ( url.com ) they will get a blank page, unless they type url.com/home

so how can i fix that?

In the www root create a file called index.php and put this in:
<?php headers("Location: /home"); ?>
Who has time for a signature?
Code
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?jyourdomainhere.net$
RewriteRule ^(/)?$ directoryto/redirectto [L]

File you can just edit and paste into your public_html
http://expirebox.com/download/acb2618669...70480.html
I don't middleman any deals on- or off-site. Please don't message me requesting my past services and certainly don't fall for anybody who claims to be me.
One more problem.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?jyourdomainhere.net$
RewriteRule ^(/)?$ directoryto/redirectto [L]

Works.

Except I had to remove 'j' (www.)?jyourdomainhere.net$
Was that an error? or was i wrong to remove it

Also, directoryto i put home, is the redirectto the same? home?
OP surely you want your website to redirect to
http://www.domain.com
NOT
http://www.domain.com/home

Whose going to remember to add /home on the end?

If I were you, I would transfer all files to public_html folder so it comes under the initial root directory.


If you still want to continue on with home the code given in the example above for .htaccess file:

OR you could upload a file within the root directory with
Code
<?php  header( 'Location: http://www.domain/home' ) ;  ?>
Naming the file index.php

Would not advise this method though as it might affect SEO results.
Web Designer / Developer & SEO Expert.

View Work
Earn 10% of the job you refer me to!

Skype aerox.design




Possibly Related Threads...
Thread / Author Replies Views Last Post
by a_different_usernameJan 7, 2019 12:27 PM 0 166 Jan 7, 2019 12:27 PM
Last Post: a_different_username
[Wordpress] by Snowf0xOct 14, 2018 02:18 PM 1 121 Oct 14, 2018 02:18 PM
Last Post: Jdxo
by dark.teamApr 27, 2016 09:32 AM 1 121 Apr 27, 2016 09:32 AM
Last Post: D3xus