# Htaccess Redirect will lead to wrong port

**URL:** <https://community.localwp.com/t/htaccess-redirect-will-lead-to-wrong-port/25264>\
**Category:** Support\
**Created:** [April 15, 2021, 6:46pm UTC](https://community.localwp.com/t/htaccess-redirect-will-lead-to-wrong-port/25264 "2021-04-15T18:46:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![modiX](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/modix/32/12268_2.png) [@modiX](https://community.localwp.com/u/modiX)\
**Post date:** [April 15, 2021, 6:46pm UTC](https://community.localwp.com/t/htaccess-redirect-will-lead-to-wrong-port/25264/1 "2021-04-15T18:46:09Z")

</div>

I added some very simple redirect in the .htaccess in localwp:

```
Redirect 301 /test.xml /wp-json/custom/v1/test-xml

```

but it always redirects to [https://example.org:10029/wp-json/custom/v1/test-xml](https://example.org:10029/wp-json/custom/v1/test-xml)

It must not change the port, why this is happening, please?

---

<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:** [July 14, 2021, 6:46pm UTC](https://community.localwp.com/t/htaccess-redirect-will-lead-to-wrong-port/25264/2 "2021-07-14T18:46:11Z")

</div>

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