How to configure a WordPress blog to save uploaded images to a certain dir.? - wordpress

I have a WordPress blog installed on my server but when i upload a image it goes into one directory, but the blog front end is looking for the images in another directory, so the images show as broken. I have been manually copying the uploaded images from server location to the one WP looks for them in and it works.
How can i set the WP blog to upload to the same dir on the filesystem that the WP front end is trying to pull from?

The problem is most likely WordPress failing to correctly guess the upload path and URL.
Go to Settings > Miscellaneous and hardcode the correct path and full URL.

Related

Folder permissions for custom Wordpress uploads folder

I have created a new Wordpress website on my server and done everything as I normally would (nothing fancy or custom, just upload theme, a couple of plugins etc.) except I wanted a custom file path to my media folder.
I have created the folder '/public_html/i', updated my .htaccess file, updated the Setting > Media section in Wordpress with the file path and all is working fine.
My issue is that I do not want the uploads folder to be visible by navigating to the URL (www.site.com/i/).
If I change the folder permissions to execute only for group / world (711) the images become unavailable / unviewable and although I can still upload they show as broken images.
If I set to execute and read (755) the images and uploads work fine but the folder can be viewed by typing in the URL.
What are the correct permissions I should be using for a custom uploads folder to make images on the site viewable but the containing folder itself not?
Note that this is a site that will regularly have new images uploaded to it, so I would also need to be able to upload without having to change the permissions each time, which is one solution I have found online.
Thanks in advance for any help.
Add the following to your .htaccess file with the WordPress .htaccess instructions:
Options -Indexes

How to locate index.html / index.php in cPanel

I am editing a wordpress website. My client had a team working on editing it and they simply used the Wordpress editor to make changes. When I log in to cPanel, I see a 'coming soon' page in the index.html file. But the changes that the design team made cannot be located in any file. Also, when I access the website with a http, it shows the website (even when it's not supposed to be launched) and when I access the website with a https, it shows the welcome page. I don't know how two different pages are displayed by just changing the transfer protocol. How do I edit the theme?
If it is a WordPress website, the index file should be under this directory:
/website-root/wp-content/themes/ <- then the theme folder.
The theme, that's active on your website should be mentioned under Appearance > Themes. If you're not sure which one it is in /themes directory, look for the title here.
As you have cPanel, you should have an access to .HTACCESS file for your account. You can set index/default page for your website from .HTACCESS file. Please add the following code:
DirectoryIndex MyFileName.html // Replace MyFileName.html with your actual index file name.
HTTP and HTTPS should show the same contents. Please clear browser cache or verify your website from any alternate system or server.

WordPress - How to replace all wp.me shortlinks?

I have a website which is hosted at wordpress.com and I want to transfer this one to an own hosted environment. The current website on wordpress.com includes a ton of links which are shortened with wp.me and have been used to link from a page to another page/post.
I want to change the internal links to "normal" links, because otherwise the links are directing still to the site at wordpress.com. How can I do that? Is there a way to do this (semi-)automatically? Any chance to get a table that shows the permalink and the corresponding shortlink?
Thanks!
you can use this script, I think it's the best for wordpress migrations.
Download
Create a new folder in the server root directory
Upload the files in to that directory
Type the correct url www.yoursite/yourdirectory
Enter the current url in your DB and the new Url
Click in dry run and then live run
Remember to download a copy of the DB.

Wordpress - Moving website admin section

I have successfully moved a wordpress site from /test directory to the root, so now the website url looks like www.example.com. Fine.
However the admin section (wp-admin) still points to /test directory and so the url looks like www.example.com/test/wp-admin/...
How can I make it like www.example.com/wp-admin/...?
Please notice that I'm not interested in a simple redirection (now the customer is able to access the admin section with www.example.com/wp-admin, but then he's redirected to www.example.com/test/wp-admin/..., and it's not what he wants.
Thanks in advance
Everything is documented in http://codex.wordpress.org/Moving_WordPress
You may need to change many URLs in post/page content; if so, see https://github.com/interconnectit/Search-Replace-DB as suggested in the above Docs.
There is no need to create a new Wordpress install.
Also see http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install if you want to keep core Wordpress files and folders in a subfolder, but have the site appear to be at root for the end user.
You should not move wordpress this way. Here is what you do:
Install Clean Wordpress Installation on the new domain.
(www.original.com)
Use a plugin* to make back-up on your test domain.
(www.original.com/test/)
Install plugin* on the new domain, and restore back-up from test
domain. (www.orignal.com)
Update your style.css, header.php, index.php & footer.php if it
contains hard written links to your test domain.
You cannot simply move a wordpress installation - as most entries, links etc. are stored in the database. If you move folders in your ftp they will still point to the old database. This is why you have to duplicate your site, where the database entries will be automatically updated to your new site domain. Hard written links in any theme php files will have to be updated.
Although your problem depends on how your pointers/sites are set-up in c-panel. If you have to change pointers for your directory, you might have to back-up your website and upload it to a different domain so your new site can access the restoration back-up file via http request.
*Plugins such as wp clone, duplicator.

Blank page on localhost/wordpress/wp-content/themes/mysitename

I'm creating my own WordPress theme and I've set it up locally with MAMP. It all works fine and the theme appears when I enter localhost/wordpress in my browser. But when I enter localhost/wordpress/wp-content/themes/mysitename it is just a white blank page.
In the WordPress dashboard under themes the image next to my theme where it lets you activate it is also blank.
How can I get it to appear? Thanks in advance!
WordPress uses a frontend controller system where all site traffic passes through the index.php file in the root of the site.
Directing your browser to "localhost/wordpress/wp-content/themes/mysitename" bypasses the main controller, which means you are bypassing WordPress altogether and attempting to directly access files on the server. That directory would need to have an index.html or index.php file within it to produce some kind of output.
In order to have an image beside your custom theme in the admin, you need to create a screenshot of your theme and name it "screenshot" (can be a jpg or png) and place it in the root folder of your theme. Look inside other WP theme folders for an example of what I am talking about.

Resources