how to redirect a url with port via htaccess

2

1

Im Trying to Redirect a Single url

like http://tracker.niresh.co:12495/announce to http://tracker.niresh.co/announce.php

How can i get it working through htaccess ?

The KingMaker

Posted 2013-11-23T14:28:11.733

Reputation: 103

Answers

3

RewriteEngine On 
RewriteCond %{SERVER_PORT} 12495
RewriteCond %{REQUEST_URI} ^/announce 
RewriteRule (.*) http://tracker.niresh.co/announce.php

Harikrishnan

Posted 2013-11-23T14:28:11.733

Reputation: 1 334

I have applied the code but doesnt seems to be working – The KingMaker – 2013-11-23T14:40:21.417

@user1862521 mod_rewrite has to be enabled on the server for that to work. Try executing a2enmod rewrite (as root) and restarting Apache afterwards. – n.st – 2013-11-23T17:02:15.357