logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: .htaccess maintaining path + query
Author
atti



Joined: 28 Sep 2016
Posts: 1
Location: UK

PostPosted: Wed 28 Sep '16 9:31    Post subject: .htaccess maintaining path + query Reply with quote

Hi There,
I'm trying to write a .htaccess rule that can re-write the beginning of the url and maintains the rest of the url.

Original: www.mydomain.com/:80/r/32429
Redirected: www.mydomain.com/r/32429


The .htaccess should remove the /:80 and keep the rest as the /r/number is dynamic.

I have tried this:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^/:80/$
RewriteRule (.*) /$1 [R=301,L]

It doesn't seem to do anything

Can anyone help?

Thanks
Back to top
spser



Joined: 29 Aug 2016
Posts: 97

PostPosted: Wed 28 Sep '16 16:21    Post subject: Reply with quote

www.mydomain.com/:80/ ?

80 is prot?

www.mydomain.com:80/r/ ??
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 11 Oct '16 21:32    Post subject: Reply with quote

Port 80 is the default port for http://

no need to add in the the url.
Back to top


Reply to topic   Topic: .htaccess maintaining path + query View previous topic :: View next topic
Post new topic   Forum Index -> Apache