wordpress-project icon indicating copy to clipboard operation
wordpress-project copied to clipboard

why does it add /wp to url?

Open timbakkum opened this issue 7 years ago • 2 comments

I am using your starter project for a project locally and have my MAMP host set to the public directory, but why I go to my project localhost, it automatically adds /wp to every url. I.e. local.myproject/wp or local.myproject/wp/wp-admin Why does it do this and is there any easy way to get rid of this?

edit: I seemed to have gotten rid of the /wp in the url by moving the .htaccess file up one directory and changing the rewrite base and rule to / from /wp. I'm by no means an expert with this, so wondering if this is the right way to do it or is there a better way?

update: this actually makes /wp-admin and /wp-includes inaccessible.. anybody got an idea on how to get around this issue? I'd appreciate it.

timbakkum avatar May 26 '18 20:05 timbakkum

@timbakkum You need to set two URL-s.

wp option set home https://example.com
wp option set siteurl https://example.com/wp

WP-CLI is your friend.

szepeviktor avatar Jul 21 '22 09:07 szepeviktor

@timbakkum see line 29 in composer.json.

Since this is a composer-based WordPress set-up, WordPress core needs to be in its own directory, separate from wp-content. Otherwise, updates to core would wipe out wp-content.

having core in /wp/ and having it exposed in the URL shouldn't break anything. If you don't like it visually, you can set up rewrite rules in your web server to rewrite requests to /wp-includes and /wp-admin to the correct location.

gilzow avatar Jul 21 '22 16:07 gilzow