Yes, the 404 is because the local and remote server URLs are different. As a solution:
- You should set the local domain to be the same as the remote server
- In wp-config.php connect to the remote DB
- When you will need to access the remote server you’ll need to update the file
hosts
and comment out the line with your remote url- If your
hosts
file is updated on start/stop of your local server you can just stop the server and you’ll have acces to the remote
- If your
If your domain name is xdirtseries.co.za
you should set in vhost the server name and alias to match the domain, so that when you local server is started you’ll see the local version, otherwise your online version.
ServerName xdirtseries.co.za
ServerAlias www.xdirtseries.co.za
And the hosts file:
127.0.0.1 xdirtseries.co.za www.xdirtseries.co.za
This should work 🙂
Related Posts:
- Delete all post meta except featured image
- Set Display Name to first and last name (phpmyadmin SQL Query)
- Emojis getting converted to “?”
- Delete all post meta except featured image Using SQL
- WordPress database import: Row size too large
- Changing root password in PHPMyAdmin for WordPress Database when going live
- Can’t update WordFence Options, clear data manually
- Installing local to live WP into subdirectory
- DB prefix not updating
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- Missing latest posts and options after DB migration via phpMyAdmin
- Check if a database is well installed
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- importing a CSV into phpmyadmin
- Using wpdb to connect to a separate database
- Checking if Database Table exists
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- How to fetch Data in WordPress using MySQLi or $wpdb
- wpdb->insert multiple record at once
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- How to define composite keys with dbDelta()
- Is it possible to define two databases for one installation?
- WordPress for a very large website
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- “MySQL server has gone away” since update to 3.8
- Error establishing a database connection – with Debug Data
- How to execute mulitple statement SQL queries using $wpdb->query?
- Can I transfer a mysql database to another site?
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- MySQL Syntax Error upon restoring database from backup [closed]
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- Is it safe to convert tables from MyISAM to InnoDB?
- Migrating database / content of non-CMS site to WordPress
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- How do I properly update the WordPress database password?
- wpdb_prepare with multiple or condition
- Accidentally deleted active_plugins portion of the wp_options DB table
- Adding new row to wp_post table
- WordPress Install and Database on separate hosting?
- SQL Error wp_commentmeta – incorrect table definition
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- How do I get the posts within a certain year/date(with sql query)?
- Using GROUP CONCAT in my-sql query with wp_usermeta table
- Migrating from PDO using SQLite to clean new install using MySQL
- Migration: Copying database content to a different server
- Call to undefined function get_user_meta() – trying to access data in MySQL from custom fields
- Better ads plugin has 500.000 entries in wp_postmeta
- Connection refused on locahost after importing database?
- Duplicated site isn’t recognized as a site
- Query multiple tables at once?
- Have working sql query… trying to adjust it to use $wpdb
- How to properly check if a table exists in WordPress Database using Show Tables Query
- creating new field on mysql
- Remove empty rows from the database
- Custom WordPress Table wpdb
- How and where is wordpress adding mySQL content to database?
- how to encyrpt DB_PASSWORD in wp-config
- SQL query to set posts in bulk based on the post content
- How can I detect right db type?
- Changing order of db results when encoding to JSON
- Remote database -> massive response time increase?
- Second ezSQL initialization for MSSQL
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
- Delete user with only subscriber role
- Is there any way to monitor a MySQL db and check what has changed?
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- Recovery – Restore Database after moving folder location locally
- Replacing javascript link in WordPress database without getting mysql syntax errors
- How to edit custom table data in frontend
- local wordpress broke after changing URL
- how to access 2nd Mysqli Database from different server for wordpress
- Deleted products from woocommerce are still in the database
- Error establishing a database connection – WordPress setup, everything else is working
- Store GravityForm data in phpmyadmin (mysql)
- What is recommended data type and encryption type for password in a database
- How to map data on CSV to web pages?
- WP website showing blank page after moving from subdomain to main domain
- How to create index (sql) to a meta_key?
- Search and Replace in Windows XAMPP site
- WPCLI search and replace in a particlar site dir effect another site-dir
- How can i syn wordpress user table with a stand-alone php script?
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- WordPress Database Posts Table query
- Hang Up Followed By Can’t select database
- How to extract some part of WordPress full source code
- Mysql Queries per Visit – Crazy High
- using same mysql user with many databases
- Why are my WordPress post queries so slow?
- Migrated to Namecheap, now Trouble with Database & wp-config [closed]
- Custom wordpress SQL statement for a website
- How to find fresh (last modified) and sql backup?
- Uploading to WordPress Database