Moderator
James Huff
(@macmanx)
Volunteer Moderator
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.wordpress.org/Moving_WordPress#Moving_Directories_On_Your_Existing_Server
or
https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install
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)
Volunteer Moderator
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)
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.
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)
Volunteer Moderator
What exactly do you see when you try to preview a post?
I get a 404 error/page not found in the content area.
When I change the “Site Address (URL)” back to http://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)
Volunteer Moderator
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.
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)
Volunteer Moderator
Ah, sorry about that, that’s fine.
Any luck after re-saving the permalink structure?
Yup!! that seemed to have fixed the preview issue. Once again thanks for the help.