Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Redirect - report specific URL in Browser Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 25 August 2008 at 2:37pm | IP Logged Quote dalede

Hello All,
    I currently have http://www.pedssci.com/default.aspx redirecting to --

http://www.mcjconsulting.com/shriners/2009/default.aspx

I would however like the clients browser to still report that it is at

http://www.pedssci.com and NOT http://www.mcjconsulting.com/shriners/2009/default.aspx

the files for pedssci.com are subdirectories of the mcjconsulting site --
the specific subdirectories would be /shriners/2009/

is there any way I can do that ??

here is my current code..
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.49

RewriteEngine on

#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]

RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

#RewriteCond %{HTTP_HOST} ^mcjconsulting\.com
#RewriteRule ^/(.*) http://www.mcjconsulting.com/$1 [R=301,L]

#RewriteCond %{HTTP_HOST} ^pedssci\.com
#RewriteRule ^/(.*) http://www.pedssci.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www.pedssci.com$ [NC]
RewriteRule ^(.*)$ http://www.mcjconsulting.com/shriners/2009/$1 [R=301,L]


Thanks...

(obviously the #commented out rules dont run -- I have them there to help me remember whats going on with the rule above it...) so .. I am looking for a way to turn the last rule back into http://www.pedssci.com in the clients browser but still go to http://www.mcjconsulting.com/shriners/2009/ 


Dale


Edited by dalede - 25 August 2008 at 4:38pm
Back to Top View dalede's Profile Search for other posts by dalede
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4701
Posted: 26 August 2008 at 4:58am | IP Logged Quote Anton

Please try to use the following:

RewriteCond %{HTTP_HOST} ^www\.pedssci\.com$ [NC]
RewriteRule ^(.*)$ http://www.mcjconsulting.com/shriners/2009/$1 [NC,P]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 26 August 2008 at 6:28am | IP Logged Quote dalede

Hello Anton,

   I hope all is well with you.

    The code you had me try works -- however it breaks the CSS script I think. 

   Could you give me an expample of how to exclude a /directory/ or even /directory/directory/ ?

I have left it in place so you can go look at it.

compare http://www.pedssci.com with http://www.mcjconsulting.com/shriners/2009/Default.aspx

 

Thanks...

Dale

    Many thanks again for you help..

Back to Top View dalede's Profile Search for other posts by dalede
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 673
Posted: 26 August 2008 at 7:14am | IP Logged Quote Vyacheslav

Hi Dale.
Please try these rules:
Code:
RewriteCond %{HTTP_HOST} ^www\.pedssci\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://www.mcjconsulting.com/shriners/2009/$1 [NC,P]


__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 26 August 2008 at 7:45am | IP Logged Quote dalede

Hello Anton,

   Well those fix the GFX but -- it is displaying the wrong site content.

I am guessing in need to put the specific /directories/ to ignore ?

(as before its runnning so you can see whats going on --)

With the new rules your essentialy looking at http://www.mcjconsulting.com now.. and not the pedssci.com content....

Thanks...

Dale

Back to Top View dalede's Profile Search for other posts by dalede
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 673
Posted: 26 August 2008 at 8:15am | IP Logged Quote Vyacheslav

Hi Dale.
You can use these, to exclude some directories:
Code:
RewriteCond %{HTTP_HOST} ^www\.pedssci\.com$ [NC]
RewriteRule ^/(?!(?:dir1|dir2)$)(.*)$ http://www.mcjconsulting.com/shriners/2009/$1 [NC,P]

Where dir1 and dir2 - directories for exclusion.

__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 26 August 2008 at 9:49am | IP Logged Quote dalede

Hello Anton...

Just to let you know -- this is what I endded with copying the CSS and Images directories into the /shriners/2009/ folder --- Thanks for you help!

 

here is my current code..
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.49

RewriteEngine on

#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]

RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]


RewriteCond %{HTTP_HOST} ^www\.pedssci\.com$ [NC]
RewriteRule ^(.*)$ http://www.mcjconsulting.com/shriners/2009/$1 [NC,P]

Peace..

Dale

 

Back to Top View dalede's Profile Search for other posts by dalede
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 26 August 2008 at 3:50pm | IP Logged Quote dalede

Hello Anton -- Well I have a new problem --

It seems that this code works just fine in IE7  but fails misrably in FireFox.

 

so with IE7 if you go to http://www.pedssci.com you will see what your supposed to see.

If you go to http://www.pedssci.com with firefox ... the pain will be obvious...

If however you actualy type http://www.pedssci.com/default.aspx in fireforx ... it works fine.

The code I am currently using is...

 

# Helicon ISAPI_Rewrite configuration file

# Version 3.1.0.49

RewriteEngine on

#Fix missing trailing slash char on folders

RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]

RewriteCond %{HTTPS} (on)?

RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]

RewriteCond %{REQUEST_URI} (.+)

RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.pedssci\.com$ [NC]

RewriteRule ^(.*)$ http://www.mcjconsulting.com/shriners/2009/$1 [NC,P]

 

so since IE7 is dealing with it just fine -- is there a way to add "default.aspx" to the end of the URL for firefox only ..??  of if thats not possible .. is there a way to specify default.aspx...

 

Thanks...

Dale

 

 

 

 

 

 

Back to Top View dalede's Profile Search for other posts by dalede
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 26 August 2008 at 3:58pm | IP Logged Quote dalede

Anton,

   It appears that my Cache in Firefox was actualy causing the problem -- however it would be good to know how to force add defautl.aspx anyway -- as if someone else had a cache problem i could overcome it this way ....

Thanks...

Dale

Back to Top View dalede's Profile Search for other posts by dalede
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4701
Posted: 27 August 2008 at 4:55am | IP Logged Quote Anton

Please try to use this rule:

RewriteCond %{HTTP:User-Agent} Mozilla
RewriteRule (?!default.aspx)(.*)$ $1/default.aspx [R,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 27 August 2008 at 6:38am | IP Logged Quote dalede

Hello Anton...

Adding the user-agent code caused this..

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /shriners/2009/shriners/2009/default.aspx/default.aspxx.rwhlp

 

It also turned the url into this...

http://www.pedssci.com/shriners/2009/shriners/2009//default.aspx/default.aspx

 

Thanks..

Dale

Back to Top View dalede's Profile Search for other posts by dalede
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4701
Posted: 27 August 2008 at 7:27am | IP Logged Quote Anton

Please try this rule:

RewriteCond %{HTTP:User-Agent} Mozilla
RewriteRule ^(?!.*default\.aspx$)(.*)$ $1/default.aspx [R,L]

And provide rewrite log records for it in case of failure.


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
dalede
Newbie
Newbie


Joined: 10 June 2008
Location: United States
Online Status: Offline
Posts: 12
Posted: 27 August 2008 at 8:02am | IP Logged Quote dalede

Hello Anton --

I forget how do I enable the rewrite logs again?

Thanks

Dale

Back to Top View dalede's Profile Search for other posts by dalede
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4701
Posted: 27 August 2008 at 8:15am | IP Logged Quote Anton

You should put the following directive into httpd.conf:
RewriteLogLevel 9


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum