FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to redirect to a particular directory





ibay
I want to make http://website.frih.net/forum as the default page.

that is

http://website.frih.net

points to

http://website.frih.net/forum

This was stated in an earlier post:
Quote:
RewriteEngine On
RewriteRule /.* http://mysite.frih.net/wp


but it didn't work for me. whats the correct way of doing it?
mathiaus
Code:
RewriteEngine On
RewriteRule /(.*)$ http://mysite.frih.net/forum/$1

Try the above in .htaccess in public_html
ibay
thanks but it didn't work. it gave the same 403 Forbidden Error
Bondings
ibay wrote:
thanks but it didn't work. it gave the same 403 Forbidden Error

Did you replace the "mysite" part with your actual subdomain?
shoes22
ibay wrote:
I want to make http://website.frih.net/forum as the default page.

that is

http://website.frih.net

points to

http://website.frih.net/forum

This was stated in an earlier post:
Quote:
RewriteEngine On
RewriteRule /.* http://mysite.frih.net/wp


but it didn't work for me. whats the correct way of doing it?

In the .htaccess file, try
DirectoryIndex forum.php
or whatever the file is you want Wink
mathiaus
shoes22 wrote:
n the .htaccess file, try
DirectoryIndex forum.php

Thats for setting the home page that the domain alone will use. What the user wants is pretend that files in a directory, aren't but are just in the public_html.


EDIT: This code definitely works (and requires no changes)!
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^(.*)$ /forum/$1
ibay
Bondings wrote:
ibay wrote:
thanks but it didn't work. it gave the same 403 Forbidden Error

Did you replace the "mysite" part with your actual subdomain?


Sure I did it



When I used this code:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^(.*)$ /forum/$1


I still got this error, which I am writing here:

Quote:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@megaspire.frih.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


Thanks all of you for the help, maybe I am doing a stupid thing which results in this error.
Blaster
just go to the redirect button and it will do it for you. Its not hard to do. If you still need help pm me and i'll do it for you.
TomS
Put an index.php in to your root directory.
Type the following:

Code:

<?php
header("Location: forum/index.php");
?>


So when someone enters "yoursubdomain.frih.net" he will be forwarded to "yoursubdomain.frih.net/forum/index.php"
ibay
Blaster wrote:
just go to the redirect button and it will do it for you. Its not hard to do. If you still need help pm me and i'll do it for you.


Thanks, so please tell me the way to do it. I tried but I dont know the correct format to write REDIRECT and REDIRECTED URL.
I want to redirect http://megaspire.frih.net to http://megaspire.frih.net/forum

Does redirecting in this way any different from redirecting through .htaccess?
Is it any different for search engines?


TomS wrote:
Put an index.php in to your root directory.
Type the following:
Code:

<?php
header("Location: forum/index.php");
?>

So when someone enters "yoursubdomain.frih.net" he will be forwarded to "yoursubdomain.frih.net/forum/index.php"


Thanks, thats also a good way which I did not know, I'll try it after accepting defeat from that htaccess thing
Blaster
ibay just pm me your information and i will do it tomorrow. This is the easiest way for it to be done right.
ibay
Which info? my username and password? Why don't you tell me what to put in those two text fields?


Upto now, only this thing has worked:
Code:

<?php
header("Location: forum/index.php");
?>


but it shows the full URL http://megaspire.frih.net/forum/index.php instead of http://megaspire.frih.net which is what I actually wanted.
ibay
Should I give up using .HTACCESS? Maybe there is a problem with the server or my account settings are causing .htaccess errors.
Bondings
Ibay, a redirect is supposed to redirect to the other url.

What I think you want to do is show the contents of the forum directory when you access your subdomain. You need some .htaccess directives for that. But I don't understand why you don't simply move the files from the forum directory to the public_html one?
ibay
Bondings wrote:
Ibay, a redirect is supposed to redirect to the other url.

What I think you want to do is show the contents of the forum directory when you access your subdomain. You need some .htaccess directives for that. But I don't understand why you don't simply move the files from the forum directory to the public_html one?


The reason why I want to do this: I have many PHP Scripts in thier own folders, if I put PHPBB files and folders in root directory, then PHPBB's files and folders will get mixed up with the folders of other Scripts.
The second reason is that I have no definite idea what to put in the default page, so I want to point it to any Folder whenever I change my mind.
Lastly, I thought this was a good feature of FRIHOST and I didn't think it would be such a trouble to use it.
Bondings
ibay wrote:
Bondings wrote:
Ibay, a redirect is supposed to redirect to the other url.

What I think you want to do is show the contents of the forum directory when you access your subdomain. You need some .htaccess directives for that. But I don't understand why you don't simply move the files from the forum directory to the public_html one?


The reason why I want to do this: I have many PHP Scripts in thier own folders, if I put PHPBB files and folders in root directory, then PHPBB's files and folders will get mixed up with the folders of other Scripts.
The second reason is that I have no definite idea what to put in the default page, so I want to point it to any Folder whenever I change my mind.
Lastly, I thought this was a good feature of FRIHOST and I didn't think it would be such a trouble to use it.

I'll try to give you some .htaccess code for it when I have some more time. It's pretty complex but should be pretty short.

(and yes .htaccess files do work on the server for sure)
ibay
Bondings wrote:

I'll try to give you some .htaccess code for it when I have some more time. It's pretty complex but should be pretty short.

(and yes .htaccess files do work on the server for sure)


Thanks for spending time for this problem, but I thought of this as a simple problem which could be easily solved.
And I remember that you put me on a cronjob for changing file ownerships to me, could this cause any problem? the ownership of .htaccess file is with my username.
Related topics
req: PHP to list files in directory, and link to them
Hide Part of Your Web Site from Yahoo!
Online directory
Java tutorials
Master Tutorial on SEO
Permissions on my root html directory
Account Settings Page, Edit Directory Listings
.htaccess file
apache httpd.conf setup for subdomains
.htaccess redirect?
Redirect Problems - 50FRIH reward
301 Redirect
Robots.txt
Site won't redirect to /index.php
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.