After testing for hours, finally get it done.
Here the solution:
In database wp_options
change the value for siteurl
and home
from your wordpress url
to /path/to/wordpress
Then add these code in the bottom of wp-config.php
define('WP_HOME', 'http://' .$_SERVER['HTTP_HOST']."https://wordpress.stackexchange.com/");
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . "https://wordpress.stackexchange.com/" );
Now you can use Domain and IP together to access your wordpress. Of course you need to setup your webserver to listen to both
*It is not my VPN limitation though, just because I can and I think this is more cool.
Related Posts:
- Please explain how WordPress works with MySQL character set and collation at a low level
- Will it break my site if I delete all transient records in wp_options table?
- Connect to database using wordpress wp-config file
- What is the purpose of the option name hack_file in the options table?
- delete_option() and update_option() returning false
- How to change option recently_edited?
- store simple data in get_option()
- WP_Options ID high
- Transient RSS feeds in wp_options not removed automatically?
- Accessing two databases
- Long option names fail silently?
- save new data to wp_options non-post form
- Huge wp_options table
- Custom DB_COLLATE (collation) value not working on fresh install?
- Cannot unserialize WordPress serialized values in `wp_options` table?
- WordPress DB: options-table –> 32 gzipcompression?
- wp_options table has duplicate rows and primary key / autoincrement has been removed
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- What ALL can cause “Another update is currently in progress.”? [closed]
- Why can’t I swap a DB in a WP install? [closed]
- Should I remove transients from the wp_options table?
- I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?
- Can I have multiple database users within WordPress?
- Accidentally deleted active_plugins portion of the wp_options DB table
- Error establishing a database connection on Installation
- Moving WP from local server to live, error establishing a db connection
- batch UPDATE autoload value in wp_options table
- Multiple wp_options tables to share content across installs
- Connect to a remote database for wordpress in my own hosting server
- Switching Databases in LocalHost
- Localhost to Staging to Development Dynamic WP-CONFIG
- How to share plugin created database tables between two WordPress sites
- Is there an atomic way to update_option in WordPress (to ensure data integrity)?
- Does auto_load to ‘no’ in wp_options improve performance
- Check if an option exists and get its value in one hit
- My options table is huge. What can I do?
- Change options table prefix only
- When to use custom DB tables or add_option?
- In which format the data is stored in WordPress Databases?
- Problem migrating to localhost
- Is my way to change WordPress server is correct?
- how to encyrpt DB_PASSWORD in wp-config
- Automate WordPress website setup with prefilled data
- Image link issues after importing a database backup to my local web server
- Getting WordPress to work inside a rails 3 application
- Can two domains use the same database?
- WordPress keeps redirecting to localhost
- Native timestamp on wp_options option
- Whats the best practise on how to store json data from a custom settings page?
- How to re-connect WP files in lampp/htdocs to new SQL database to recover site under development
- WordPress Settings API Overrides My Previous Value
- What structure and database storage method should I use for temporary storage that may be written concurrently?
- get_option() does unserialize and don’t remove \
- Duplicate database to roll back theme & content changes
- Confused over wp-config.php and ‘database user + database password + name’
- Cloned site not connecting to database – MAMP
- I cannot change anything in my wordpress database from within wordpress?
- execute custom function on database connection error
- Does WordPress Support Using Named Pipes on the Windows Operating System?
- I have include wp-config, should I add global $wpdb also?
- Wrong url for the images while using same database for two WordPress installations
- Can’t Install WordPress (local) Failed to open file wp-includes/wp-db.php
- Issue “Error establishing a database connection” problem.
- Options table – where does my values go?
- Theme options not being sent to Database
- /var/run/mysqld/mysqld.sock
- DB access blocked when initializing WP externally
- How to use remote db tables in current config? [duplicate]
- ERROR: “Table Prefix” must not be empty
- How do I use update_option to give me a new option name each time a form is submitted? [duplicate]
- Can I connect WordPress website with an external database?
- wp-config was suddenly updated
- MySQL SELECT increment counter
- Exclude Statement in SQL
- what is the wp_5_posts table in the database?
- What is the database table for pages?
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- Is database safe after merging a branch of a more recent version over an older one?
- Hook to be used when creating a database table
- Is it possible to store visitors IPs in wp_postmeta table?
- A field with dashes in the slug [closed]
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- Creating a Video Content Page (how to use query strings in wordpress)- Help!
- Best way to tell if a user account is active, using the database only
- wp-config dynamic hostname in WP_HOME and WP_SITEURL
- Handling large N data in WordPress
- Catalina an MAMP Database Conenction Error
- A MySQL DB within a MySQL DB
- Is there a way to recover the table wp_term_relationships?
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- Update WP install to WP network & it broke the DB connection
- Directly editing WP database issues
- add_post_meta — not working
- How can I query the db to access current post information?
- Insert variables into wpdb in custom post template
- $wpdb->insert duplicating rows
- Free version of Relevanssi doesn’t show ACF fields
- Using $wpdb to insert data into a table
- Media library images “missing” after migrating them using SQL
- WordPress ERD mistake?