Try adding this to your wp-config.php file:
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
That will define your site URL as whatever happens to be in the browser location bar. Very useful for moving a site from server to server without actually changing the siteurl and home location in the database. Just don’t leave this on a production site.
Dalton
Related Posts:
- Have multiple local wordpress installs share a wp-content folder and database
- Import live site to local setup without access to live site
- Can local WordPress installs share /wp-content/ folder and database?
- Design problems when exporting remote database for local development
- Image link issues after importing a database backup to my local web server
- New installation fatal error in 5.9.3 at edit or create entry
- Error establishing a database connection with XAMPP
- Cloned site not connecting to database – MAMP
- I have my full special database from xampp how can i use this on wordpress?
- Does WordPress Support Using Named Pipes on the Windows Operating System?
- Storing Images in DB – Yea or Nay?
- How to fetch Data in WordPress using MySQLi or $wpdb
- Is sanitize_text_field() is enough to save to DB?
- Does wpdb add considerable overhead on queries with large result sets?
- Dealing with Many Meta Values, 30+
- Ways of managing staging and production wordpress sites?
- What is the most secure way to store post meta data in WP?
- Corrupt WordPress Database
- Faulty restore of the database, encoding issue
- Updating all rows of table with $wpdb
- What actions affect files, DB, or both?
- Cannot unserialize WordPress serialized values in `wp_options` table?
- Is $wpdb->prepare escaping to much? How to use it properly?
- How to log database changes during an upgrade?
- Using same database for main and subdomain
- What is stored in the webserver? (Separated Database)
- Remove database entries where post_date > expiration date
- Installation with sql server express edition
- Emojis getting converted to “?”
- Building a Scalable Resiliant WP Setup
- Single database for multiple instances
- Get all tags not just first 10 with wp api 2.0
- Should non-WordPress data get its own DB?
- Search and replace special characters (å,ä,ö) for image attachments only in database
- Accidentally deleted active_plugins portion of the wp_options DB table
- Automate dir and DB stack creation with WP-CLI
- Moving WP from local server to live, error establishing a db connection
- delete post meta from db, even if does not exist?
- In what part of the WordPress core does the users table and usermeta table get joined?
- WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
- Output custom content not from the posts table?
- Reducing Database Query Time
- How can I get my wordpress password from an SQL file?
- Create table from array with prepare
- Migrate database between 2 different wordpress version
- Is there an atomic way to update_option in WordPress (to ensure data integrity)?
- Form that sends data to an admin panel and can export it
- All text disappeared (seems to be a database problem) [closed]
- Convert user passwords to MD5?
- is wordpress stores Role Id in WP database?
- Why do database examples sometimes finish with an add_option call?
- How to backup my site and restore my wordpress site
- How and where is wordpress adding mySQL content to database?
- restore a db after bad backup
- How get Data form wordpress database as array not stdclass?
- cannot connect database
- How to delete a particular row in a database table
- Brandoo WordPress Unable to Update to WordPress 4.2.2
- Connecting to wordpress database in my application [closed]
- change the year on all of my custom post types?
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- Delete user with only subscriber role
- WordPress keeps redirecting to localhost
- get value from ‘terms’ table
- custom tables in wordpress Database? (can i just create them with sql?)
- How to rename custom table name programatically in wordpress?
- Displaying requested data from a the database in wordpress
- Accidently changed the GUID
- How to edit custom table data in frontend
- pre_get_posts causings DB error when using ( ‘posts_per_page’, -1)?
- generate PDF from member information
- Is it safe to add INDEX to a column in WordPress database?
- Help posting values to DB on submit using $wpdb->query
- Restore Old Database Over Newer WP & Plugin Files
- wpdb query to insert images in to post/page gallery
- Creating a database in my plugin not working
- How to create index (sql) to a meta_key?
- Not sure what to do next to optimize
- Database structure for thousands of posts
- get_user_meta and umeta_id
- $wpdb not working
- Accessing content from third party as native posts in WordPress
- Extracted CSV as Array for Custom Query Loop
- One WP Database outside localhost and two connections
- Send data to database after redirect (and popping out of iframe)
- Fetch data from another site, but the same database
- Simple email input store in database
- Every time I update or install a plugin I get “Error Establishing a Database Connection in WordPress”
- Media Library won’t recognize SOME old files after move
- Error at time of WordPress Installation
- WordPress dbdelta a semicolon
- single.php not pulling in any data from database
- How do I use update_option to give me a new option name each time a form is submitted? [duplicate]
- How do join in query with WordPress
- How to create a table that interact with database in real time
- WordPress Theme Customize doesn’t save changes
- How can i change the nicename and the displayname in a bulk in the database?
- cannot access wp-admin after options table crash and repair
- How to update multiple row by one query
- Have WordPress Use a Different Database for users