Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: yasmikash on February 13, 2018, 06:43:32 AM

Title: Creating another website along with the forum in the same host
Post by: yasmikash on February 13, 2018, 06:43:32 AM
I have a forum built using Simple Machines Forum under the main domain. I'm trying to make another website on a different directory in the same host that my forum has been installed on, and use www. myforum .com/mywebsite as the web address of that website. I have no idea how to do that on my own 'cause i'm a very beginner to this stuff  :P. Can you guys help me with that?
Title: Re: Creating another website along with the forum in the same host
Post by: Kindred on February 13, 2018, 09:49:32 AM
set up a second database and then just run the install.php in your new directory
Title: Re: Creating another website along with the forum in the same host
Post by: yasmikash on February 13, 2018, 10:45:59 AM
set up a second database and then just run the install.php in your new directory
Thank you for your reply. I have created a sub-folder and included all the necessary contents into it, but when I access the site using the url, it redirects me to the homepage of the forum. Is there any wrong I'm doing here, and sorry for being a noob.
Title: Re: Creating another website along with the forum in the same host
Post by: Kindred on February 13, 2018, 11:12:33 AM
what are the URLs involved.

When you say that you "included all the necessary contents into it", what do you mean? 

Did you create a new database?
Did you put the install archive in the directory and then extract the files/sub-directories?

Do you, perhaps, have an htaccess file in your root that automatically tries to redirect anything?
Is the forum in your root directory using prettyurls?
Title: Re: Creating another website along with the forum in the same host
Post by: yasmikash on February 13, 2018, 01:15:43 PM
what are the URLs involved.

When you say that you "included all the necessary contents into it", what do you mean? 

Did you create a new database?
Did you put the install archive in the directory and then extract the files/sub-directories?

Do you, perhaps, have an htaccess file in your root that automatically tries to redirect anything?
Is the forum in your root directory using prettyurls?

I mean by "necessary contents" that all the website files, and, yes, I installed a new database and assigned the details to the website.

There is no htaccess file in my root directory.

I had used prettyurls on my forum for a while, but now I have removed it from my forum.

My sub-directory folder name is 'dashboard', so every time I try to access to website through the address myforum.com/dashboard, it redirects me to the forum with this url - myforum.com/dashboard/?pretty;board=dashboard.0
Does prettyurls have to do with anything about this?
Title: Re: Creating another website along with the forum in the same host
Post by: Kindred on February 13, 2018, 02:46:19 PM
you still have pretty urls active, then.... that's the problem.

and there must be an .htaccess file in your root...   that's how pretty urls does the redirect
Title: Re: Creating another website along with the forum in the same host
Post by: yasmikash on February 13, 2018, 09:51:08 PM
you still have pretty urls active, then.... that's the problem.

and there must be an .htaccess file in your root...   that's how pretty urls does the redirect

Ok. There is a .htaccess file in my root directory.

Code: [Select]
# PRETTYURLS MOD BEGINS
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: December 23, 2017, 12:16

RewriteEngine on
RewriteBase /

# Rules for: profiles
RewriteRule ^profile/([^/]+)/?$ ./index.php?pretty;action=profile;user=$1 [L,QSA]

# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# PRETTYURLS MOD ENDS
#Remove index.php completely via htaccess Mod
#Remove index.php completely via htaccess Mod
RewriteEngine on
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
#Remove index.php completely via htaccess Mod
#Remove index.php completely via htaccess Mod

Should I remove the .htaccess file, or is there something to change in the file?

Edit:
And it works after I removed the .htaccess file in my root directory, but there is another problem. When someone try accessing website using an address like this - myforum.com/something, it throws out '404 Not Found' error, instead of redirecting back to my forum homepage. How do I get rid of this?
Title: Re: Creating another website along with the forum in the same host
Post by: Kindred on February 13, 2018, 10:28:08 PM
You disabled the showing of index.php, didn’t you?
Title: Re: Creating another website along with the forum in the same host
Post by: Illori on February 14, 2018, 05:11:40 AM
You disabled the showing of index.php, didn’t you?

i believe that is part of the pretty urls mod.
Title: Re: Creating another website along with the forum in the same host
Post by: yasmikash on February 14, 2018, 06:55:14 AM
You disabled the showing of index.php, didn’t you?
Yes. I have disabled showing index.php.
Title: Re: Creating another website along with the forum in the same host
Post by: Kindred on February 14, 2018, 09:48:58 AM
that causes all sorts of problems.  don't do that.