Forum Moderators: phranque

Message Too Old, No Replies

Mod Rewrite for port 2095

How to redirect domain.com:2095 to domain.com/login.php

         

boy143878

9:48 pm on Apr 1, 2008 (gmt 0)

10+ Year Member



Hello,

I have been trying to figure this mod_rewrite thing out for days with no luck. What I need to have done is when a user accesses this URL [domain.com:2095...] or [domain.com:2095...] to be redirected to [domain.com...] Is this even possible?

This is what I have so far, but does not work at all.

RewriteEngine on
Options +FollowSymLinks
Order allow, deny
Allow from all
RewriteCond %{SERVER_PORT} =^2095$
RewriteRule ^.*$ [domain.com...] [L,R]

Thank You,
Lance

jdMorgan

1:41 am on Apr 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Redirect example.com:2095/login or example.com:2095/ (and nothing else) to example.com/login.php :

Order allow, deny
Allow from all
#
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{SERVER_PORT} ^2095$
RewriteRule ^(login)?$ http://example.com/login.php [R=301,L]

This code is intended to be placed in the root .htaccess file of the virtual server which you have configured to listen to port 2095. For use in httpd.conf or conf.d, prefix the URL-path in the RewriteRule pattern with a "/" -- that is, use "^/(login)?$"

Jim

boy143878

1:52 am on Apr 2, 2008 (gmt 0)

10+ Year Member



I have a reseller account and do not have root access. Does this mean it will not work.

jdMorgan

4:02 am on Apr 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does this mean it will not work?

If you cannot now connect on port 2095, you should ask your host.

Jim