Home Remove :8080 from url with htaccess?
Reply: 0

Remove :8080 from url with htaccess?

Sasha Grievus
1#
Sasha Grievus Published in 2018-02-09 15:36:05Z

When i type my url (without trailing slash!)

http://example.com/something

it redirects to

http://example.com:8080/something

while

http://example.com/something/

works fine.

Given that I cannot touch apache configuration it is possible to redirect

http://example.com:8080/something to http://example.com/something/

using only .htaccess in my site 'something' directory?

I've tried several rewrite rules, but none seems to work... In particular, I cannot get how to write the pattern matching the :8080 part.

Tried

RewriteCond %{SERVER_PORT} 8080
RewriteRule (.*) http://example.com/something/$1 [P,L]

but got Page not found error...

Btw, there's a specific common reason for apache to redirect to :8080 if there's no trailing slash?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301427 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO