Redirect from different port to subdomain – htaccess

Question

I created a Digital Ocean instance to install WordPress website 5 days ago. I already have my own domain, and created DNS Subdomain blog.example.com. The server runs both nginx and apache so my Apache port is 8082. Below is what my actual WordPress URL looks like:

www.example.com:8082/wordpress/

Something which I have tried is below.

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?example.com:8082/wordpress
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([a-z0-9-]+)/? http://$1.example.com [R=301,NC,L]

</IfModule>

Now my expected result is from

www.example.com:8082/wordpress 

to

blog.example.com
0
, George Alvis 1 year 2020-07-25T15:10:26-05:00 0 Answers 54 views 0

Leave an answer

Browse
Browse