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
- What is an ORM, how does it work, and how should I use one? [closed]
- What is the difference between an ORM and an ODM?
- What is this JavaScript “require”?
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- What is this JavaScript “require”?
- What is “Advanced” SQL?
- What’s the difference between identifying and non-identifying relationships?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- What are the differences between B trees and B+ trees?
- MySQL SELECT increment counter
- How to resolve ORA-011033: ORACLE initialization or shutdown in progress
- Example of a strong and weak entity types
- Oracle SQL query for Date format
- phpMyAdmin – Error > Incorrect format parameter?
- Strange Characters in database text: Ã, Ã, ¢, â‚ €,
- Difference between partition key, composite key and clustering key in Cassandra?
- How SID is different from Service name in Oracle tnsnames.ora
- What is a relation in database terminology?
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Database vs File system storage
- Can I have multiple primary keys in a single table?
- Exclude Statement in SQL
- How do you query for “is not null” in Mongo?
- What is a file based database?
- Is it fine to have foreign key as primary key?