I have a wordpress site on an IIS at localhost. To demo the site, I used ngrok to make the site available.
When viewing the site on localhost, everything looks fine. However, when I view the site remotely through the ngrok tunnel, the content appears, but all style & theme elements are lost.
I am not sure what code, configuration or documentation would be helpful for solving this problem.
Any idea why this may be occurring?
This happens because the links in wordpress are usually absolute, you need to force Wordpress to use relative URLs with one of those plugins:
https://github.com/optimizamx/odt-relative-urls
http://wordpress.org/plugins/relative-url/
Related
I moved wordpress website with https address to a localhost on LAMP server using All-in-one migrate plugin. Everything moved well except paths to media files (pictures).
Links to pictures in upload folder are broken. And nothing wrong with them except that they have https instead of http.
Console errors pic
I tried find/replace in wp_posts table, but it doesnt find anything. Tried to use plugin, that seems to do the same - doesnt help.
My .htaccess file is the default one from WP codex.
Weird, that I've done same process of migrating from https to localhost with another wordpress website and everything was fine.
The only difference between them, is that website with problem is using woocommerce plugin. And images are actualy products images. Maybe this will help.
UPDATE: Looks like problem is with all uploaded media files. I just've uploaded new file, and it's not showing neither. Some problems with apache configuration?
UPDATE2: Found out that this is 301 redirect problem. But where does it comes from? What to do to cancel those redirects? Do I need to edit .htaccess?
Screenshot of network tab for correspong images. Gray ones are http versions and red ones - are redirected to https
There are a few things, that I would recommend you to check.
Check your settings in the database _options table in the fields siteurl and home. You should have there http://domain-name
Also you need to check your wp-config.php. There might be rules added regarding siteurl and home using incorrect protocol.
There might be some plugins installed, which can trigger this https redirect, such as Really Simple SSL, or cache plugins, which also have settings regarding https.
And finally, check your theme code, if it is a custom theme, it also can be configured to use https in some cases.
We have a dev site www.dev.site.co.za & a live site www.site.co.za.
I wanted the dev site updated to be a current replica of the live site, so our hosting provider copied it over.
But now when if you go to www.dev.site.co.za, you are "redirected" to www.site.co.za. I have tried changing the siteurl in phpmyadmin but that hasn't resolved the issue.
Is there somewhere else the url needs to corrected and is there anything else I need to do to make sure the dev site is a completely separate environment to the live site so I can safely fiddle without damaging the live site?
wordpress not only uses the database in PHPMyAdmin for the url.
As mentioned in the official documentation there are several files that can include the url:
the wp-config.php (wordpress file)
the functions.php (theme file)
Check these and have a look for the url address.
Have a look at the .htaccess file!
Also:
Helpful for that issue (e.g. restoring a wordpress page on another server) is the plugin BackupBuddy. It is one of the most well known plugins for wordpress. (Know right now that it is a paid version! But as always there are others with the functionality).
It allows you to backup and restore your page on a new system. You can initially set your new desired address for the system then.
Maybe it is worth a look!
For rectifying your dev site issue, you can try this.
Following is the URL to a simple utility via which you can replace some value in your database with some desired value.
https://github.com/interconnectit/Search-Replace-DB
Download the utility (zip file).
Upload it to your dev site root location and unzip it there. So that the the URL of the unzipped folder becomes: www.dev.site.co.za/Search-Replace-DB-master/.
Visiting that URL will show you the screen with options to replace some values in your database with desired values.
This utility automatically selected the connected database.
Put the URL of your live site in the field to replace.
Put the URL of your dev site in the field to replace with.
Choose the Dry Run option to see what all tables and columns will be affected.
Once you see the results and know what is changing then you the click on Live Run.
Clicking on Live Run will change all the URL of your live site in dev site database with URL of your dev site.
Once the changes are done you can delete this folder.
Hope this will at least resolve the problem of redirection of dev site to live site.
Once the new site is built you can then migrate(move, copy) it to the live site's location. There are some tools out there to help with moving the site you can use once the site is done. Some require a plugin to be installed to do that though. For example magicmigration can be used to move the completed site to a new location (that one specifically doesn't take extra installs). It is also possible to manually migrate the site though depending on the situation and know-how that can be a bit much for some people.
I'm trying to display a wordpress site to a customer using ngrok.
I tried using different comments.
first of: ngrok.exe http 80 this works i see the folder where all my sites are in.
Ngrok
website 1
website 2
website 3
but when i target my wordpress website the domain changes to localhost/website1
making it impossible for the customer to see his website.
i tried setting the root of my wordpress to my custom ngrok domain. this makes it kinda work, except for the images and assets that cant seem to find their location anymore.
also i tried installing the wordpress plugin (ODT relative urls). this also broke more then it fixed.
I tried using diffrend ngrok comments, they worked but didn't change a thing.
If it is any help, i use xampp to make my files to a localhost server.
in short -
ngrok display localhost/WEBSITE instead of the desired NGROK_LINK/WEBSITE
Problem was wordpress home url was set to localhost, when loading the new url it redirected back to localhost from the database wordpress home property.
I'm trying to set up a Wordpress Multisite network on Google App Engine. I have the install up and running, and am mapping custom domains for each site with the help of this plugin. I'm using Wordpress 4.0.
The domain mapping works, in that when I navigate to the custom domain it pulls up the corresponding site, but when I try to access any admin pages from the custom domain, I get an SSL error. I gather that this is due to Google's not allowing custom domains to access GAE apps via SSL, and so I've been trying to fix this by redirecting all requests of the form mycustomdomain.com/wp-admin/(.+) to myapp.appspot.com/wp-admin/\1.
My rationale for trying this is that myapp.appspot.com/subsite/wp-admin/ works just fine, but mycustomdomain/wp-admin does not, despite the two pointing to the same location.
Unfortunately, I haven't been able to figure out how to do this redirection properly. I've tried adding redirect rules to the .htaccess file with no success. I've also tried messing with app.yaml handlers, but this, too, yielded no results.
Also worth noting is that I attempted to force all requests to go through http (as a hackish, temporary workaround) via this plugin to no avail.
I'm new to working with servers, and any help would be much appreciated. I'm not even sure that redirection is the right solution, so I welcome any other suggestions. I can supply pertinent code if needed. Thanks.
EDIT: I could go through Google's custom domain registration process via Google Apps and get an SSL certificate that way, but my app will eventually be used by a large number of independent sites that I don't control, so that solution won't work.
I have been trying to achieve something similar on a regular server and not on GAE, so I'm not sure this will apply to you...
Isn't the 4th option of the Domain Mapping what you're looking for? In the WP network administration, go to Settings > Domain Mapping, then you can tick/untick the 4th option :
4. Redirect administration pages to site's original domain (remote login disabled if this redirect is disabled)
This will allow you to use a custom domain to access a site and its wp-admin interface, allowing SSL certificates to validate since the domain stays the same.
I have WordPress installed and running on GAE and have added my own custom domain via Google Apps. This is great but my appspot.com url is still publicly accessible and searchable.
How would I go about blocking this and redirecting to my custom domain?
I imagine it involves adding a url handler in the app.yaml file that points to a php file. I have no idea what would go inside though.
Also, how would I then go about setting up a 301 redirect for website canonisation and SEO that accounts for SSL and cron entries?
Any help is appreciated, thanks!
The appspot.com URL is always accessible and there is no way to turn it off. You can't do much in the app.yaml since it's not aware of the custom domain. I'm not really a PHP guy but you should do is to write manually the redirect based on the host URL if you really want to do that. Since you're using WordPress you might need to do quite some work if you don't want to redirect only from the root, but from any page.
Personally I think you should just leave it there and do nothing, even Khan Academy is not redirecting (http://khan-academy.appspot.com) and I'm pretty sure that very few are actually doing that.