News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Moving SMF to a different folder error

Started by TrentT, July 23, 2014, 05:45:23 PM

Previous topic - Next topic

TrentT

Hey there again,

I'm trying to move my SMF from the public_html to a folder inside the public_html, but the layout looks bugged and everytime I click on something, it redirects me to a page (error) as it would be in the public_html.

For example, a link redirects me to:
website.com/index.php

while it should be:
website.com/community/index.php

I have tried running a repair_settings.php in the same folder as Settings.php but that didn't work out for me. There is also a link on top which says: ''The default theme's directory is wrong, please correct it by clicking this text.'' but clicking that, doesn't fix my problem.

From what I could've seen, I can say that the database paths are all correct.

Any thoughts?

Justyne

what does it actually suggest as the path? Maybe, that's not correct.

Obviously it should have your new subfolder in it.

Are you sure you moved all the files?
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

TrentT

Yes, I'm sure that I've moved all possible folders and files to the new folder. At the moment, the links are acting as the files and folders would be in the public_html (website.com/**filehere**) instead of ''community'' in between (website.com/community/**filehere**)

Justyne

then put the community in there and that should fix it.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

margarett

That's something repair_settings should fix.
You said it didn't work out, what exactly happened?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

TrentT

Quote from: Justyne on July 23, 2014, 05:55:10 PM
then put the community in there and that should fix it.

Yeah well, your comment is not helping me at all.


Quote from: margarett on July 23, 2014, 05:56:19 PM
That's something repair_settings should fix.
You said it didn't work out, what exactly happened?

I downloaded the repair_settings from this page (http://wiki.simplemachines.org/smf/Repair_settings.php), directly from the download section without changing any values. I uploaded (and removed afterwards) it to the /community sub-directory, but it still looks bugged.

Arantor

It won't magically fix anything just by putting it there. You have to use it to change the values, to include community.

Justyne

#7
you might have to change the values. Check the paths displayed in repair settings and if they actually point to the correct places.

If your path is public_html/community you should see this in the paths of repair settings. If its not there put it there and save.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

margarett

Quote from: ‽ on July 23, 2014, 06:17:46 PM
It won't magically fix anything just by putting it there. You have to use it to change the values, to include community.
^^ This ;)

The wiki should help you understand better what to do with it.
What is repair_settings.php?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

TrentT

Oh wow, I forgot to actually head over to the file (/community/repair_settings.php) and set the paths manually. I thought it would somehow fix everything automatically, but after reading that topic and your comments again, I got it figured now.

Thanks alot for the quick responses guys! ;)

Justyne

Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

margarett

Nice ;) Don't forget to immediately remove the file after using it!
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Bob Perry of Web Presence Consulting

yea and even if you forget the system will tell you next time the admin logs in...

extremely useful tool...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

TrentT

Eh, so after I moved the forum to the /community sub-directory, you will get alot of dead links in topics aswell. Any ideas on how to fix that?

Bob Perry of Web Presence Consulting

All your internal links should be fine, if there are broken external links, then I would guess that they were messed up -before- the move as well.

would you post a link to your site and let's have a looksee?

Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

TrentT

Quote from: Bob Perry on July 24, 2014, 05:00:34 AM
All your internal links should be fine, if there are broken external links, then I would guess that they were messed up -before- the move as well.

would you post a link to your site and let's have a looksee?

Here's an example of what I mean:
http://www.avttdm.com/community/index.php/topic,5770.msg41521.html#msg41521

Old topics which are still reffering to the old links, didn't get updated automatically. External links are fine as those didn't change.

Note: If you look around the forum, you might notice that some links are correct. I updated them by hand.

Arantor

There's no automated way to do that, mostly because doing find/replace on a database is a heavily nasty operation to do - since it has to go through the entire database post by post and all the time it's doing that, it's not letting anyone else look at posts.

Yazar8

Quote from: ‽ on July 24, 2014, 05:25:36 AM
There's no automated way to do that, mostly because doing find/replace on a database is a heavily nasty operation to do - since it has to go through the entire database post by post and all the time it's doing that, it's not letting anyone else look at posts.

If we were going to do this, what query would I need to execute?

Justyne

Yazar, I don't recall the table names off the top of my head but somewhat like this

UPDATE messages
SET posts = REPLACE(posts, 'string1', 'string2')
WHERE posts LIKE '%string1%'
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Arantor

Yup, that's the general format.

UPDATE smf_messages
SET body = REPLACE(body, 'yourdomainhere.com/index.php', 'yourdomainhere.com/community/index.php')
WHERE body LIKE '%yourdomainhere.com/index.php%';


And then wait.

Yazar8

Quote from: Justyne on July 24, 2014, 05:34:25 AM
Yazar, I don't recall the table names off the top of my head but somewhat like this

UPDATE messages
SET posts = REPLACE(posts, 'string1', 'string2')
WHERE posts LIKE '%string1%'

UPDATE avttdmc2_forummessages
SET body = REPLACE(body, 'avttdm.com/index.php', 'avttdm.com/community/index.php')
WHERE body LIKE '%avttdm.com/index.php%'

Is this correct?

Edit: Question mark answered me, meh. Lemme try this.

Arantor

That's 'interrobang' ;)

But yes, that's the way to do it :)

Yazar8

 O:)
Quote from: ‽ on July 24, 2014, 05:46:45 AM
That's 'interrobang' ;)

But yes, that's the way to do it :)

Ah sorry. I learned something new :P

Anyway I executed this query it did its job in 1-2 seconds. Didn't take that long. There were only 479 posts like that.

Though I also need to change them on the topics, because this query only changes replies.

Bob Perry of Web Presence Consulting

might be a good idea to put your forum into maintenance mode first, should something go awry

Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Arantor

QuoteThough I also need to change them on the topics, because this query only changes replies.

No. The smf_messages table contains every post in the forum, including the first post in topics.

Yazar8

Quote from: ‽ on July 24, 2014, 05:51:10 AM
QuoteThough I also need to change them on the topics, because this query only changes replies.

No. The smf_messages table contains every post in the forum, including the first post in topics.

Oh alright. Then


Yeah my forum is still on maintenance mode and I'm going to keep it on it for a few more minutes just incase the query didnt finish.

Arantor

If it came back to you, it finished already.

Yazar8

Quote from: ‽ on July 24, 2014, 05:53:21 AM
If it came back to you, it finished already.

Yeah I got the response, its completed. Good job : D

Thanks to everyone for their help.

Trent mark this as solved pls.

Arantor

Sub 500 posts shouldn't take a long time. It gets slower the more/longer posts you have, roughly proportional to the total amount of content it has to wade through.

TrentT

Alright, everything seems to work fine now.

Thanks again for your time and quick responses ;)

Justyne

Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Kindred

also... form your urls, it looks like you have that silly "SEF" checkbox checked...      I recommend unchecking that. it is pointless, serves no real purpose, and often confuses things later on.  (it's left over from years ago when search engines had to have an .html marked page to understand how to catalog it)
Сл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."

Arantor

You should see how much effort I had to go to in this current mod project to specifically work around that nonsense.

kat


Advertisement: