How to amend a WordPress site's URL? - wordpress

I have setup my site with 5 pages which are my menu options.
When running my WordPress site on my local host using MAMP, my url is:
http://localhost:8888/mySite/ or http://www.example.com/ (when I go live)
When I click on a menu item, it changes the URL to:
http://localhost:8888/mySite/MenuOptionA or http://www.example.com/mySite/MenuOptionA
How can I setup a Permalink or something else, so that it always just shows my main URL above without the /MenuOptionA when I have click on any menu options?
I basically would like my url to always just show http://www.example.com/ no matter what menu option is selected.

You can change you're site's url easily by adding in the following statements into wp-config.php
define('WP_HOME','http://www.mySite.com/');
define('WP_SITEURL','http://www.mySite.com/');
If you don't want to maintain two different config files, you can put a conditional in there to determine what value to use.

Related

site_url in wp_options table mismatch with site URL in settings > general

I'm working with a client on a Wordpress instance that resides at subdomain.maindomain.com. They would like it to appear as www.maindomain.com/subdomain.
Prior to my tenure they spun everything up with a reverse proxy and have the site appearing at www.maindomain.com/subdomain successfully... EXCEPT when you attempt to navigate within the WordPress admin dashboard.
For instance, clicking on the arrow for next page to navigate within the posts produces the following link (resulting in an error):
https://subdomain.maindomain.com/wp-admin/edit.php?post_type=page&paged=2
where it should produce:
https://www.maindomain.com/subdomain/wp-admin/edit.php?post_type=page&paged=2
This happens throughout the admin dashboard (creating a new user, etc.), despite the permalinks for the public facing pages being generated correctly.
What's setup correctly:
wp_home and wp_siteurl in wp_config.php are both set to www.maindomain.com/subdomain
Site and home URL are also both set to www.maindomain.com/subdomain in Settings >> General in the WordPress admin dashboard.
Possible issue?
I did notice in the wp_options table that the site and home URLs are both set to subdomain.maindomain.com. Could that be the root of the issue?
I can also provide the htaccess base rewrite rules here if that's helpful.
Beyond resolving this troublesome issue, I'm also generally curious if there are any instances in which a mismatch between the site/home URLs in Settings >> General and the wp_options table would actually be a good thing? It seems like this mismatch would always be bad.

how to change the url of the custom links in menu section - wordpress

I created a development site in a sub-folder. I changed the site url and base url of the site but the custom links in the menu section is not picking the new base url. it is still picking the old path. can some one help me.
I believe it will change only your domains URL but you need to change all links follow instructions below:
First method
1. login to admin-end go to setting general setting
2. change your old website URL into home tab
3. change your old website site URL from site tab then same it.
Go to setting permalinks set default then save again change it to post name and then save.
Second Method
1. Open your PHPMyAdmin select your database
2. Open the table wp_options.
3. Change the site URL and admin URL from old to new.
Go to setting permalinks set default then save again change it to post name and then save.
For more information check this link
Thanks

Wordpress redirect

I have a wordpress installation on a wp folder.
I need my clients write
www.example.com
in the browser, and the page
'about'
to be displayed, preserving the www.example.com address, not showing the www.example.com/wp/about/ address.
Which are the proper way to do this?.
You can assign it by go to setting -> Reading and choose the page you want to display at Front page displays. You can choose either page or posts.
Just update WordPress.
This bug is not present in current versions...

Issue On Displaying Pages with Post Name Permalink

I have a simple Theme like below
Right now when I navigate to localhost and site root directory I am able to see content from header.php , footer.php and page.php.
then, I simply generated some pages for Navigation bar and to get a better URL I updated the permalink from default to Post Name format
Now while I have the the clean Ur as: Permalink: http://localhost/RumiPress/eyeglasses/
But when I click to view the page I am getting
I Google this and find some hints about the (.htaccess) so I just copied same format as Cedex
but still getting same result. Can you please let me know why this is happening?
Thanks
Apache's mod_rewrite module needs to be enabled in order for "pretty" permalinks to work in WordPress, as specified in the codex.
You're using WAMP, so this can be done by:
LEFT click on the green WAMP icon in your notification tray
Click on Apache --> Apache modules
Enable rewrite_module (make sure it's checked)

wordpress page permalink is not working on local

I have wordpress website on server, created pages and that's working fine, but when I download wordpress files and DB on local and want to run with localhost, permalinks for pages are not working.
It seems this is an old post, but this might help others that encounter same error.
Select:
Apache –> Apache Modules –> and that will display the lists of available modules.
Now just check rewrite_module.
source from WordPress Custom Permalink not Working in Localhost
Hope that helps.
Sometimes when copying from one server to another, wordpress' permalinks goes a little screwy, try setting them back to default (using the admin panel) and then setting them again to your desired permalink structure (being sure to apply the changes each time).
you need to go into the database and change a few options.
Goto your phpmyadmin installation and navigate to wp-options table. Change the siteurl and home options to your localhost address.
Wordpress needs these database tries to build your permalinks. If they are wrong, then it will direct your links to incorrect locations.
You can simply fix this by doing the following:
Go to settings in your WordPress site.
click on permalinks ( You will see the URL structures of your newly configured WP site. (if it shows your original website values, go to settings-> general and set your local site URLs
Don't do any changes, just click on the Save button.
Refresh your local site and click on your page link or post.

Resources