News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

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.

Advertisement: