question when using /forum for install

Started by Nodaz, April 10, 2016, 02:22:01 PM

Previous topic - Next topic

Nodaz

i have an install of smf that has been running for years, it was installed in the public_html folder so obviously it is the first thing you see when you navigate to the url.

I am going to install SMF on a second url, BUT this time i think i will install it in a /forum folder, my question is what is the best method to (re)direct traffic directly to the forum when they type in the URL.
eventually id like to install a landing page of some sort in the public folder but they will come later.

Kindred

Сл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."

Nodaz

#2
ok, ive not done much of anything with htaccess, after looking around a bit i see it is recommended to use htaccess only if i dont have access to the main server configuration file.
Is that something accesable through cpanel, how do i know if i have access to it?

That said, what would i put in the htaccess file or change in the server config file?

Edit:
ok looks like i need to do a 301 redirect?
example, put this in the file:

301 / http://my-example.com/forum

or should i do a temp redirect:

302 / http://my-example.com/forum

Kindred

I don't know who says that recommendation... Personally, I think htaccess is the roper way to deal with it almost all the time.


# This allows you to redirect index.html to a specific subfolder
Redirect / http://example.com/forum/


I think that should work.
Сл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."

Nodaz

installed but running into another issue, ill create a separate thread for it.

Nodaz

Quote from: Kindred on April 10, 2016, 08:35:08 PM
I don't know who says that recommendation... Personally, I think htaccess is the roper way to deal with it almost all the time.


# This allows you to redirect index.html to a specific subfolder
Redirect / http://example.com/forum/


I think that should work.
redirect fails, the redirect adds this to the end of the url
/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/forum/
nothing in the htaccess file expect what you recommended

Nodaz

after a little hunting around i found this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ forum [L]


supossed to be seach engine friendly and it worked to redirect obviously, change domain in 3rd line and folder name between $ [L] in last line

Kindred

yeah....  that one is better. :)

I see what happened with the other one -   it got caught in a loop of redirect
Сл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."

Advertisement: