• Resolved webshot

    (@webshot)


    Right now I have my wp install in a sub folder off the root on my host server. For example https://mysite.com/site. I do not need to or want to move the site to the root or another folder. But what my host does offer is the ability to point my url to a folder essentially making the site appear to be in the root so the user only sees https://mysite.com. But when I do this images and the CSS does not appear to load thus breaking the site. I tried changing the URL settings in the “General” section but that does not work either. By the way my host is 1and1 if this is any help.

    Any tips or advice is greatly appreciated.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Moderator James Huff

    (@macmanx)

    Yeah, that isn’t going to work that way. While your host can make the site appear at example.com, your files are still in example.com/site, which suddenly WordPress can’t find because of what your host did. Basically, there really isn’t a way to selectively “lie” to just the visitors about where the site’s files are, while also telling WordPress to ignore that. The method works fine for static sites that are just straight HTML files, but not a CMS like WordPress which always needs to know where its resource files are.

    If you want to move WordPress up one directory, you only have two options which are supported here:

    https://codex.www.ads-software.com/Moving_WordPress#Moving_Directories_On_Your_Existing_Server

    or

    https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

    Thread Starter webshot

    (@webshot)

    I follow the directions to a T, using the option under the heading:

    Using a pre-existing subdirectory install

    When I do things are not working and I get this error:

    Parse error: syntax error, unexpected ” );’ (T_ENCAPSED_AND_WHITESPACE) in /homepages/27/d625513063/htdocs/index.php on line 17

    Any ideas?

    Moderator James Huff

    (@macmanx)

    Sounds like the file wasn’t exactly modified correctly. Make sure that the line is exactly this, no extra spaces, extra characters, misspellings, or typos:

    require( dirname( __FILE__ ) . '/site/wp-blog-header.php' );

    (and, of course, replace site with the exact name of the directory where all the files are)

    Thread Starter webshot

    (@webshot)

    Thanks a BUNCH James. You are right there was a space after the line. I used your last post and it worked. I seriously appreciate it.

    Moderator James Huff

    (@macmanx)

    You’re welcome!

    Thread Starter webshot

    (@webshot)

    One thing I do notice however is previewing a post seems to not work under this new setup. But the site itself does. Any ideas on that?

    Moderator James Huff

    (@macmanx)

    What exactly do you see when you try to preview a post?

    Thread Starter webshot

    (@webshot)

    I get a 404 error/page not found in the content area.

    Thread Starter webshot

    (@webshot)

    When I change the “Site Address (URL)” back to https://mysite.com/site and access the preview with the additional /site in the url it works. Everything seems to work but previewing my posts at this point.

    Moderator James Huff

    (@macmanx)

    But you moved all of your files out of /site right?

    Try re-saving your permalink structure at Settings/Permalinks in your admin panel. If WordPress cannot automatically edit the .htaccess file, it will provide manual instructions after saving.

    Thread Starter webshot

    (@webshot)

    No all my files are still in /site. The directions I followed didn’t have me move them. I am trying to prevent having to do that.

    Moderator James Huff

    (@macmanx)

    Ah, sorry about that, that’s fine.

    Any luck after re-saving the permalink structure?

    Thread Starter webshot

    (@webshot)

    Yup!! that seemed to have fixed the preview issue. Once again thanks for the help.

    Moderator James Huff

    (@macmanx)

    You’re welcome!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Changing URL destination folder causes WP to break.’ is closed to new replies.