Wordpress redirect loop with MAMP pro on local machine - wordpress

I downloaded a wordpress website to my local machine and set up a host on MAMP Pro with an export of the live database, now I keep hitting a redirect loop on the main page when I try to view the website, it doesn't matter whether I reset the .htaccess file, clear all my cookies, delete my plugins or do any other of the recommended things it keep coming back. The official error is:
This webpage has a redirect loop
ERR_TOO_MANY_REDIRECTS

I had the same issues. Somehow resetting the permalinks settings in the admin panel to plain fixed the problem.

Are you using HTTPS by any chance? If so you may want to add
$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_ADMIN', true);
To the top of your wp-config.php file.
You might want to also check your database to see if the site url's are correct.

As I was moving from Windows environment to Mac OS probably on the copy files i was missing the install.php file. And when i tried to install the theme it would bring me the redirect loop screen.
It was confusing to me because I was following all steps at the end I went to look for the install.php and saw it was missing there put it in the place and voila!
Maybe will help i don't know, for the next readers to come!

I was able to resolve an identical issue by doing the following:
In the wp_options table of your site's database check if the port numbers for option_name siteurl and home match those of your server. Update them if not.
Remove the port number from $root_dir in wp-config.php
This error occured on an older project running Wordpress 4.1 after changing the ports on my MAMP apache server months earlier. Hope that helps.

Related

301 redirect error with wordpress and apache

I've recently migrated a database from windows using bitnami (apache and wordpress) to a linux server (apache and wordpress). I'm able to access the website wp-admin, but every time I try to access the main site it repeatedly returns 301 errors.
I've tried disabling the .htaccess file (deleting, commenting everything out), but it still gets directed. I've disabled all plugins. I've looked into the themes I'm using but they don't have redirect url's like I've seen in other posts.
I'm wondering if the issue might be in how bitnami structures itself. the main documents are stored in website/wordpress/htdocs, whereas linux wordpress seems to store it directly in wordpress.
I've set sites-enabled home directory to
sitelocation/wordpress/htdocs
I've also set the wordpress address and site address to
http://website.com:80
What do I need to do to prevent the redirects, or set it up to work correctly?
if you haven't change your Site URL then.
Please change the Site URL and Home URL from database in wp_option table.
You need to mention new url in both section..
I had a trailing / on my siteurl which led to it not working. After removing that it worked.

Wordpress installation says not supported

I do not have a domain yet so I want to use a temp URL to access my Wordpress site. I have installed Wordpress as normal, changed siteurl and home in the MYSQL database to the new temp url, but all i get when i visit my site is 'Not Supported'.
I had setup previously setup another account with a domain and that worked fine. I have trawled the internet and cannot find anyone who has had this problem before?
Hope you can help
I had the same issue. Turns out it’s a server configuration issue with Apache. You can confirm that is also your problem by placing an empty index.php in your home directory in the place of WP’s index.php. If you still get the error, that’s what is going on.
Here’s the Apache documentation on it:
https://documentation.cpanel.net/display/ALD/Apache+FAQ#ApacheFAQ-WhydoIreceivea%22NotSupported%22messagewhenIattempttoaccessmywebsitewithamod_userdir-styleURL?

moving WordPress over to domain, after working on it locally through MAMP

I've finished the styling changes on WordPress and I'm ready to move it from MAMP to my domain.
Will this involve any changes to the WordPress files or can I just drag it over to my new domain once I purchased it?
The main start you must make is update your wp-config.php
define('WP_HOME','http://www.mynewdomain.com');
define('WP_SITEURL','http://www.mynewdomain.com');
That way wordpress knows what domain it MUST run from.
The reason you do that is because without this you may not be able to access admin, login, etc etc.
When this is working and you have logged in, go to wp-admin and go to your permalink settings.
Make a NOTE of your settings, then change them to default (and woocommerce settings etc).
Go to your home page and a few others, and notice how messed up your urls look :)
Now go back to permalink settings and restore them (the point of this is to make sure your .htaccess file that wordpress depends upon is set correctly)
Finally, have a look at https://github.com/veloper/WordPress-Domain-Changer to change your sql etc if needed.
note this method is very handy for developers so you just update your wp-config.php for localhost or development or production (not for testing purposes, don't use your local pc. copy it all up to a subdirectory of your hosting partner e.g. http://www.mynewdomain.com/mytestarea. Make sure you use a COPY of the mysql database (never point both to the same database). You now can test on the hosting platform without disturbing the live site or your development causing issues to other people.
It's been a long while for me personally, but you'll want to change the SiteURL via the options menu in wp-admin.
Otherwise, just make sure your MySQL database is exported over, your credentials and user permissions are all setup and those work too.
If you still have problems:
https://codex.wordpress.org/Changing_The_Site_URL
https://codex.wordpress.org/Moving_WordPress
The database has to be updated. What always works for me is that I export the database from phpMyAdmin or MySQL (using mysqldump) and open the exported .sql-file with a text editor, like Sublime Text.
Now you want to find any occurence of your previous URL. Let's say on your dev machine the URL to the index of your Wordpress site is http://localhost:8080/wordpress and you want it to be on a website under https://domain.com you simply do a Find & Replace using that and replace everything with https://domain.com.
For older Wordpress versions you have to update the .htaccess files if you have custom URL's.
You have to make a search replace in your database and replace your local domain ( test.lo ) with the live domain ( test.com ).
To do this you can use the script from here: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Add the searchreplacedb2.php file in your route folder and the access test.lo/searchreplacedb2.php and follow the steps there. This will replace your local domain with your live one everywhere in the database.
You can't make a simple search-replace because the local domain might be serialized in some fields in the database, and a simple search-replace will not replace those.

Wordpress Live copy & Xampp with different port

So there is this live wordpress-site and I have to make some new adjustments. Therefore I dumped the whole database and copied the files via FTP to my localhost (c:\xampp\htdocs\mycopy).
However I run XAMPP on port 808 and the wp-copy can't deal with this.
http://localhost/mycopy/
404 - Not found
Tried it with
http://localhost:808/mycopy/
301 - moved permanently -> redirects to
http://localhost/mycopy/
and that gives again 404 not found.
Then I found the wp_options table in the database and set the "siteurl" and "home" both to
http://localhost:808/mycopy
Still no change...however I can open
http://localhost:808/xampp/splash.php
with my browser and it`s working like a charme.
Additional note:
http://localhost:808/mycopy/wp-admin/
redirects to www.livepage.de/wp-admin/
What did I miss?
You need to change links in database. WordPress stores full path links in the DB.
Set DB_HOST to "localhost:808" in wp_config.php
Then use this tool to replace urls in the database:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
just follow the instructions
I found the prob....and I am as dumb as a brick. httpd.conf has this line
#Listen 12.34.56.78:80
and I changed it to 127.0.0.0.1:808
now take a wild guess what my problem was....But thx for your answers, I appreciate it!

Wordpress site not loading

My wordpress site is not loading for some reason. It was working perfectly two days ago and now, whenever I try to access the home page, it stays loading. Same behaviour if I try to go to the admin page.
I checked my server logs and nothing.
Changed plugins forlder name and nothing
enabled debug in wp-config and nothing
Any ideas?
Thanks
Console says that it fails to load css and javascript :S
My only suggestion would be to check and make sure that both your CSS and Javascript files are still in the same place as specified and to check the links to them.
I am in the development phase, so the site is on my laptop. I just changed the 'siteurl' and 'home' options in the wp_options table to 'localhost' and it started working again. I was using my IP address. So I am guessing it has to do with port forwarding?
After restarting the router, I was able to access the site again through my external IP address.
Cheers
Use localhost in your site_url setting or be sure your IP doesn't change.

Resources