Wordpress - ftp'd site/exported database to localhost, localhost images still point to .com, why? - mysql

I FTP'd over the entire wordpress site and exported the Database and got it running on my localhost throught WAMP, but for some reason the links and folder are still pointing towards it's .com, and a 404 error comes up as well.
I suspect it has something to do with .htaccess but I'm not sure.. Can someone steer me in the right direction?

Did you update WordPress Address (URL) and Site Address (URL) under General > Settings?
They might still point to old domain.

Transferring the site over FTP to your local machine is the same as "moving" it to a new domain. Wordpress provides specific instructions for such a move which you can find #
http://codex.wordpress.org/Moving_WordPress
When Your Domain Name or URLs Change
When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://newexample.com - there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:
Only perform a search and replace on the wp_posts table.
Use the Search and Replace for WordPress Databases Script to safely change all instances. ( If you are a developer, use this option. It is a one step process as opposed to the 15-step procedure below )

Related

Replace URLs in Typo3 DB

So I have a Site created with Typo3. I also have a domain which is linked to the folder of the Typo3 Installation. www.example.org
I created a Subdomain and linked it to the same folder and used the Main Domain for something else.
But now everything on the Subdomain still has the URL Structure of the main site so when I open up sub.example.org all the Links and Images still have the URL from www.example.org/...
I exported the Database and replaced every URL with notepad++ and imported it again. But that didnt change anything. What do I do wrong?
There are two (three with realurl) places where you need to look if changing the domain of a TYPO3 site, if everything is done by the book and noone hardcoded the domain all over the place or something.
Usually you do not need to work in the database directly.
After doing the changes, make sure to clear the caches (install tool in 6.2+, "all caches" in earlier versions).
First:
There are two TypoScript settings that influence the generated URL: config.baseURL and config.absRefPrefix.
The recommended way to use those is to not set config.baseURL (would result in a <base> tag in the HTML <head>), and set config.absRefPrefix to the subpath where TYPO3 is, relative to the document root. If TYPO3 lies directly in the document root, set it to /.
Second:
In the database, there are "Domain Records". They are usually located on the root page of a site. Change those to the new domain.
Third (with realurl only):
Check the realurl configuration file, usually located in typo3conf/realurl_conf.php. Depending on your setup, the old domain name is used there and needs to be changed.

Website Images dont get loaded, URL looks cryptic

So on a website Iam working on some images dont get loaded.
The console says: Failed to load resource: net::ERR_NAME_NOT_RESOLVED
and then a link like that:
http://s234127563.online.de/wp-content/uploads/2014/04/myimage.png
If I change the first part of the URL http://s234127563.online.de/ to the actual URL http://example.org/ the images get shown
Does anybody know what this problem is about? Maybe some DNS thing or something. I tried different browsers and to renew my ip address and flush dns etc. but nothing changed
Looks like a mismatch in your database. WordPress stores your base URL to generate permanent links etc.
Change the URL stored in WordPress. There’s a page dedicated to that on the WordPress Codex. Hardcoding the URL in wp-config is most reliable, but perhaps not most desired.
The URLs are saved in posts etc, so you may have to update those. The Velvet Blues Update URLs plugin can do this for you.
Manually update non-default fields (theme options, custom fields, etc)
If none of the above works... are you using a CDN of some sort?
Check your database. In the wp_options table there should be 2 rows, one called siteurl and the other one called home. Make sure both are set to be your domain name, so http://example.org/
Wordpress sets this URL at the start during installation, and if you for example had this URL set to something different before, in case of a migration to a different domain name or something else, it can differ from the domain name the website is currently being shown on.

URL of Category page in Magento changed to /shop-3.html how to change it back to /shop.html

After I changed the URL key in Category management in Magento from "shop" to "webshop"and later changed it back to "shop", the url of the category page now shows up like /shop-3.html Is there a way to go back to the original /shop.html?
FOUND THE SOLUTION: http://www.youtube.com/watch?feature=player_embedded&v=8xttr_ILd6A
Sometimes when you make changes to your products, or enable a certain extension, Magento might start to rewrite all your URLs to include a suffix "-1" or some other number. Within the URL Rewrites, Magento differentiates between System URLs and Custom URLs. If the System URLs are broken like this, you should not fix this by adding new Custom URLs.
Instead, open up phpMyAdmin, create a backup of your Magento database, and flush the Magento table core_url_rewrite (so that it becomes totally empty). Immediately afterwards, refresh the Catalog Url Rewrites under Index Management. This will regenerate all System URLs.
you can edit url write,i think there will be entry like /shop-3.html just change it is you want
http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index
and also refer
http://www.magentocommerce.com/knowledge-base/entry/what-url-rewrites-are-and-why-they-are-important
hope this will sure help you.
Simple answer
just delete url related to shop (custom and system generated), than run re-indexing it will work

Some images won't show when moved Wordpress site to another domain on same server

I've developed a new wordpress website on a testing domain name on our server.
I had set the site up ready to go live... but I had to move the wordpress website onto another domain name that we are also hosting on our server.
So what I did was copy all root folder content from the testing domain name and pasted the content into the new domain name's root folder.
I then logged into wordpress, changed all the necessary settings like WORDPRESS URL and SITE ADDRESS URL as well as image absolute urls in each and every individual pages to make sure that I've got the right URL for everything.
When I click on MEDIA, I can see all the images like normal.
Great ... then I go and check the website live and I see that there are a lot of images that are missing! They are all in the MEDIA panel - but do not show up on the website!
I then double check that all images are pathed correctly ... and they all are.
Now why do SOME images show up and others don't?
I've even tried to add a new photo and use that photo in place of another photo that isn't showing up and that new photo doesn't even show up.
Where does my problem lie?
For example, 1 slideshow on my website which isn't showing images, give me an "image not found" error for a image:
Image not found: http://www.domain.com/wp-content/themes/natural
/lib/timthumb.php?src=http://www.domain.com/wp-content/uploads/2012/08/breakfast-gallery-011.jpg&w=610&h=0&zc=1
Ok I am going to answer my question with some advice.
It's clear that some of my images were 'hard coded' as devin mentioned as I could not find a logical reason for some not showing (even when I looked at the tabular data in MySQL) and because I'm not a database engineer / developer - I wasn't prepared to dive too deep into that with the possibility of causing further issues... so I decided to take down the entire wordpress site, create a new database, re-install wordpress and I imported an exported xml file that I created and saved (luckily) before 'migrating sites'.
Advice:
1) Whether you migrate a wordpress site or not, always backup your website regularly by creating an export of your wordpress structure. It may save you a lot of work in future.
2) If you're an amateur or beginner at development and MYSQL like myself, I'd suggest you create your wordpress site on the actual domain name you want it on. This will save you from 'migration' headaches as I've just experienced ... and a lot of time. Learn from my mistakes. Although there is probably a solution to my question above, it's out of my expertise / knowledge and could be out of yours too... so make it easy for yourself :)
The issue is not that the image URls are hardcoded only. The last portion of the URL is harcoded, but you will most likely have "/wp-content/" embedded in the URL which indicates that the image's URL string is dynamically created. I looked in my wp_postmeta table and there were all of the partial image URls ( like this - 2013/03/expanse2.jpg ). Now where is the beginning part of this URL and the domain name? The domain name is the part that is actually missing from the all of the image urls in my case. I dug into the database a little deeper using phpmyadmin ( but i recommend Webmin if you can get it up and running ). I ran into the "home" field in the "wp_options" table. Asked Google what a proper "home url" would be for wordpress, which brought me to this page ( http://codex.wordpress.org/Function_Reference/home_url ) , and this line was in there ( home_url() is located in wp-includes/link-template.php. ). Went to that file and found that it controls how URLs are built, but not uploaded image urls specifically. In the end i went into a page that had an image, looked at the advanced settings and found the image URL was just missing the domain. I used the wonderful search and replace script to repair it. Done

Repair links after updating my URL

I need to repair all the URLs in a Wordpress site. The problem is that the site domain was bought after the hosting plan. The hosting assigned a static IP and the site was mounted using that IP. Now I need to update over 700 links in the database from http://xxx.xxx.xx.xx/~blah/ to http://www.example.com. Is there an easy way to do it? I already checked and most of those links are in the guid column in the wp_posts table. I have access both to the wp-admin and phpmyadmin in c-panel so, any solution would be nice.
That known problem has a pretty easy bypass.
Just download that great tool right here https://launchpad.net/mysql-search-replace, put the extracted folder in you serverץ
Go in your browser to the mysql-replace.php file that inside the tool's folder.
Then, write your old ip address in the search field and your new domain in the replace field.
Fill in your hostname, database name, username and password, click on the replace button, and that's it! All the places that your IP is written in your DB will be replaced with the new domain!
I suggest to do a search before the replacing, to ensure that you'll replace the right query and not ruin your DB by mistake.