James Huff on "Changing URL destination folder causes WP to break."

ساخت وبلاگ

Right now I have my wp install in a sub folder off the root on my host server. For example http://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 http://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.

Yeah, that isn't going to work that way. While you 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

webshot
Member
Posted 47 minutes ago #

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?

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( diame( __FILE__ ) . '/site/wp-blog-header.php' );

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

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 203 تاريخ : دوشنبه 10 خرداد 1395 ساعت: 11:12