Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: .htaccess maintaining path + query |
|
Author |
|
atti
Joined: 28 Sep 2016 Posts: 1 Location: UK
|
Posted: Wed 28 Sep '16 9:31 Post subject: .htaccess maintaining path + query |
|
|
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
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 11 Oct '16 21:32 Post subject: |
|
|
Port 80 is the default port for http://
no need to add in the the url. |
|
Back to top |
|
|
|
|
|
|