# URL changes to using port when accessing wp-admin

**URL:** <https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390>\
**Category:** Support\
**Tags:** apache\
**Created:** [April 27, 2021, 5:25pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390 "2021-04-27T17:25:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [April 27, 2021, 5:25pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/1 "2021-04-27T17:25:42Z")

</div>

### Issue Summary

Accessing the frontend works fine, but any access of wp-admin adds a port into the url: [https://site.local:10079/wp-admin/](https://site.local:10079/wp-admin/). What causes this, and how to fix permanently? I know I can switch to using localhost as the URL; that is not ideal, so please do not mention unless a step in fixing the issue.

#### Troubleshooting Questions

- Does this happen for all sites in Local, or just one in particular? Occurs every time I’ve created a new site in the recent months.

- Are you able to create a new, plain WordPress site in Local and access it in a Browser? Yes

#### Replication

Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!

1. Create a new site: PHP 7.4, Apache, Mysql 5.7.28
2. Trust SSL
3. Access wp-admin directly through browser

#### System Details

- Which version of Local is being used? 5.10.1+5267

- What Operating System (OS) and OS version is being used? macOS 11.2.3

- Attach the Local Log. [local-lightning.log](https://community.localwp.com/uploads/short-url/foXotlz2DrmJbjrIVaVZrPjJdxH.log) (10.6 KB)

---

<div class="post-metadata">

**Author:** ![lflier](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/lflier/32/5540_2.png) [@lflier](https://community.localwp.com/u/lflier)\
**Post date:** [May 4, 2021, 11:22am UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/2 "2021-05-04T11:22:54Z")

</div>

I’m seeing the same thing: URL shift and a browser warning that it cannot make a secure connection.

- Local 5.10.3 on MacOS Mohave
- PHP 7.3.5 and MySQL 8.10.6 (Preferred configuration)
- Apache server

The problem seems only to occur when using Apache. But it’s intermittent. Sometimes I see it and sometimes I don’t. I was tearing my hair out yesterday until I traced it to Apache.

---

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [May 4, 2021, 4:13pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/3 "2021-05-04T16:13:42Z")

</div>

Yes, it does appear to be limited to Apache. And I can also confirm its intermittent: if I attempt to access the admin after creating a site, I get redirect, but after restarting my machine I was able to access the admin without the redirect.

I suspect some sort of SSL bug with Apache…? Don’t know if that’s a thing, but that’s what it seems like…?

---

<div class="post-metadata">

**Author:** ![lflier](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/lflier/32/5540_2.png) [@lflier](https://community.localwp.com/u/lflier)\
**Post date:** [May 4, 2021, 4:46pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/4 "2021-05-04T16:46:54Z")

</div>

Either that, or perhaps the SSL issue arises because of the issue with the URL. Apache seems somehow to be redirecting the URL that I enter in the browser.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [May 4, 2021, 7:13pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/5 "2021-05-04T19:13:38Z")

</div>

I’m sorry you are running into this issue!

I’ve tried to replicate on my macOS Catalina machine (macOS 10.15.7) but wasn’t able to get that behavior that you mention.

A couple of things to come to mind:

Do you have the latest version of the Apache Lightning service? Making the update process for Lightning Services easier is something we are wanting to do, but this FAQ has the info to get you going:

- [How can I manually update downloadable Lightning Services? - FAQ - Local Community](https://localwp.com/community/t/how-can-i-manually-update-downloadable-lightning-services/21149?u=ben.turner)

For reference, here’s a screenshot of the versions that I have installed under my `5.10.3` version of Local.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/8/826c24a53021599803b93282e15facb39c0e01bc.jpeg)

The other thing that comes to mind is about the SSL piece of this. Are either of you using a plugin or some sort of way of “forcing SSL?”

Lastly, what browser are you using? I’m doing this QA under the latest version of Chrome, but are either of you using Firefox or something else?

---

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [May 4, 2021, 7:27pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/6 "2021-05-04T19:27:59Z")

</div>

I’ll try to force a reinstall of Apache Lightning Service; I am not forcing SSL AFAIK (just the WordPress URLs) and I experience using Brave, though IIRC I’ve also experienced using Chrome.

---

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [May 4, 2021, 8:59pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/7 "2021-05-04T20:59:36Z")

</div>

@ben.turner Removed Apache 2.4.43+6 Lightning Service and re-downloaded following the steps provided; issue persisted with a new install.

After reinstalling the Apache Lightning Service, I created the following sites and tested various setups; results:

| SSL Trusted | WordPress URLs (Settings) | Resulting WordPress Admin URL |
| --- | --- | --- |
| ✗ | [http://test-apache-5.local/](http://test-apache-5.local/) | [http://test-apache-5.local:10089/wp-admin/](http://test-apache-5.local:10089/wp-admin/) |
| ✓ | [http://test-apache-6.local/](http://test-apache-6.local/) | [http://test-apache-6.local:10094/wp-admin/](http://test-apache-6.local:10094/wp-admin/) |
| ✓ | [https://test-apache-7.local](https://test-apache-7.local) | [https://test-apache-7.local:10099/wp-admin/](https://test-apache-7.local:10099/wp-admin/) (ERROR\_SSL\_PROTOCOL\_ERROR) |

The redirect occurs regardless if the SSL is trusted or not. If the WordPress Address is changed, then you can no longer access the admin (without changing the URL back).

---

<div class="post-metadata">

**Author:** ![lflier](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/lflier/32/5540_2.png) [@lflier](https://community.localwp.com/u/lflier)\
**Post date:** [May 5, 2021, 10:21am UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/8 "2021-05-05T10:21:11Z")

</div>

It seems to be browser independent. I’m seeing it in Chrome and also in Firefox.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [May 5, 2021, 9:33pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/9 "2021-05-05T21:33:08Z")

</div>

Can either of you record a screencast so I can look and see what other things are happening when the issue happens?

Also, there’s a new version of Local that was just released. I don’t think it has anything that would fix this specifically, but it might be worth a try to see if updating helps:

- [https://localwp.com/releases/](https://localwp.com/releases/)

---

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [May 5, 2021, 11:37pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/10 "2021-05-05T23:37:55Z")

</div>

@ben.turner I’ve described everything that I do… is there something specific you’d be looking for?

---

<div class="post-metadata">

**Author:** ![lflier](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/lflier/32/5540_2.png) [@lflier](https://community.localwp.com/u/lflier)\
**Post date:** [May 7, 2021, 7:38pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/11 "2021-05-07T19:38:52Z")

</div>

Screen recording below:

[https://bookdiscoverydev.nyc3.digitaloceanspaces.com/development/Local%20Apache%20Bug%202021-05-07%20at%203.27.54%20PM.mov](https://bookdiscoverydev.nyc3.digitaloceanspaces.com/development/Local%20Apache%20Bug%202021-05-07%20at%203.27.54%20PM.mov)

Screenshot of Local (5.10.4+5377):

 ![Screen Shot 2021-05-07 at 3.29.01 PM](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/f/f4565a3174b677905d1d5520569607a70ab1f2e7.jpeg)

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [May 7, 2021, 8:38pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/12 "2021-05-07T20:38:20Z")

</div>

Nice! Thanks for the screencast!

That specific error:

```auto
ERR_SSL_PROTOCOL_ERROR

```

Is a tricky one to zero in on. @crstauf – When you encounter this issue, do you have the same error?

In a general sense, this is the browser telling you that it doesn’t like the certificate. This is a very vague message, some of the items in this page would be good to try (though it’s for windows)

> **[Fix SSL Error - How to Fix ERR\_SSL\_PROTOCOL\_ERROR on Chrome](https://comodosslstore.com/blog/easily-fix-err-ssl-protocol-error-on-chrome.html)**
>
> Fix SSL Error – Most of Google Chrome users face this error. Learn how to solve ERR\_SSL\_PROTOCOL\_ERROR with these easy tips.

To summarize the ones I’d try under Mac:

1. Check the date/time of your system. Consider having it set from a server so that everything is in sync.
2. Clear the browser cache in case on older version of the certificate is present.
3. Any antivirus software installed that might be messing with the local site’s certificate?
4. In a similar fashion, any VPNs installed? I know that Local is offline software, but depending on the vpn, that might hijack and mess with the SSL certificate.

Let me know if any of those help or lead you to a solution!

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [May 7, 2021, 8:39pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/13 "2021-05-07T20:39:54Z")

</div>

> [@crstauf](#):
>
> is there something specific you’d be looking for?

Mostly wanting the exact error messages seen as well as a better idea for the context of where a request started and where you end up.

---

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [May 7, 2021, 8:51pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/14 "2021-05-07T20:51:21Z")

</div>

> When you encounter this issue, do you have the same error?

Yes, mentioned in a [previous comment](https://localwp.com/community/t/url-changes-to-using-port-when-accessing-wp-admin/25390/7?u=crstauf).

> To summarize the ones I’d try under Mac:

1. Already in place
2. Receive same error in incognito
3. Nothing beyond macOS
4. Yes, I have Cloudflare WARP installed and setup with Cloudflare Teams

---

<div class="post-metadata">

**Author:** ![lflier](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/lflier/32/5540_2.png) [@lflier](https://community.localwp.com/u/lflier)\
**Post date:** [May 7, 2021, 9:03pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/15 "2021-05-07T21:03:29Z")

</div>

Is it the SSL issue that’s causing the URL issue – or is it the other way around?

It’s not clear to me why the port is appearing in the URL. Is there a mechanism by which an SSL certificate problem could cause that? I’ve never seen it anywhere else.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [August 5, 2021, 9:03pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/16 "2021-08-05T21:03:29Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [August 9, 2021, 3:09pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/17 "2021-08-09T15:09:36Z")

</div>



---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [August 9, 2021, 3:38pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/18 "2021-08-09T15:38:40Z")

</div>

I’m sorry for leaving this topic dangling, but I was mostly at a loss for what might be causing this.

I think that this is a related issue to another topic where not including the trailing slash under apache causes the issue:

> **[Local incorrectly adds port number when logging into wp-admin of a site](https://community.localwp.com/t/why-is-local-adding-port-10084-to-the-url/25327/18)**
>
> Haha! :larry\_heart: Gotcha, I just wanted to make sure I wasn’t missing something 😃 Thanks for passing along that site, it was really helpful to see an example and as a result, I think I have distilled the steps down for a reliable reproduction: ...

> [@lflier](#):
>
> Is it the SSL issue that’s causing the URL issue – or is it the other way around?

Maybe neither ? 💀

_I think_ that what’s happening is that because Local’s router (which is basically a proxy) is running nginx, but the end site is running Apache, there’s something incorrect with how the two services are communicating.

In the above reply I linked to, I recorded my QA session and at around the 2:00 min mark and the 5:20 min mark, I get odd HTTP response codes for the various URLs. For example, as a logged out user, trying to access the wp-admin, I think there should be a `302` response to the `wp-login.php` page but instead there are `200` responses.

For the Apache site, it just breaks but for some reason nginx fails gracefully and shows the site.

I’ve filed a bug with the Local team, but I don’t have an ETA for when it will be worked.

---

<div class="post-metadata">

**Author:** ![earthmanmedia](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@earthmanmedia](https://community.localwp.com/u/earthmanmedia)\
**Post date:** [February 17, 2022, 5:23am UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/19 "2022-02-17T05:23:58Z")

</div>

I’ve been running into this issue as well.

Here’s what I am seeing, again, specific to apache like other accounts:

```
https://mysite.local/wp-admin/  

```

That redirects ok)

```
https://mysite.local/wp-admin  

```

That redirects to [https://mysite.local:10003/wp-admin/](https://mysite.local:10003/wp-admin/) (note the trailing slash now) and results in ERR\_SSL\_PROTOCOL\_ERROR

I also noticed this when I was using some custom redirects from files that used to be in root folders, in a legacy site. These redirects caused the ERR\_SSL\_PROTOCOL\_ERROR 🙂

```
RewriteRule ^js/(.*)$ /wp-content/js/$1 [R=302,NC,L]
RewriteRule ^css/(.*)$ /wp-content/css/$1 [R=302,NC,L]
RewriteRule ^enterprise/(.*)$ /wp-content/enterprise/$1 [R=302,NC,L]
RewriteRule ^images/(.*)$ /wp-content/images/$1 [R=302,NC,L]
RewriteRule ^svg/(.*)$ /wp-content/svg/$1 [R=302,NC,L]
RewriteRule ^fonts/(.*)$ /wp-content/fonts/$1 [R=302,NC,L]

```

However, when I changed them as follows, they did not:

```
RewriteRule ^js/(.*)$ https://%{HTTP_HOST}%/wp-content/js/$1 [R=302,NC,L]
RewriteRule ^css/(.*)$ https://%{HTTP_HOST}/wp-content/css/$1 [R=302,NC,L]
RewriteRule ^enterprise/(.*)$ https://%{HTTP_HOST}/wp-content/enterprise/$1 [R=302,NC,L]
RewriteRule ^images/(.*)$ https://%{HTTP_HOST}/wp-content/images/$1 [R=302,NC,L]
RewriteRule ^svg/(.*)$ https://%{HTTP_HOST}/wp-content/svg/$1 [R=302,NC,L]
RewriteRule ^fonts/(.*)$ https://%{HTTP_HOST}/wp-content/fonts/$1 [R=302,NC,L]

```

I’m pretty sure it has something to do with the nginx proxy that the LocalWP software is using, and how it is handling the WordPress redirects, but I am at a loss to be able to fix it…

Very annoying. Hoping this will help solve this (rather old) problem for everyone?

LocalWP…??

Bueller…???

.

---

<div class="post-metadata">

**Author:** ![crstauf](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@crstauf](https://community.localwp.com/u/crstauf)\
**Post date:** [April 7, 2022, 3:52pm UTC](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390/20 "2022-04-07T15:52:53Z")

</div>

@ben.turner Any progress? This is still an issue. I started experimenting with service workers which require an SSL, and now I can’t access my WordPress admin, even with nginx.

[Next page](https://community.localwp.com/t/url-changes-to-using-port-when-accessing-wp-admin/25390.md?page=2)
