List Info

Thread: Redirection




Redirection
country flaguser name
United States
2007-03-28 14:40:55
Hi,
  I am new to asp.net as such. I have this problem of
redirecting
pages. The old site was php and now has been redesigned
using asp.net.
I was assigned a task to put redirections for 25 most viewed
pages. So
if the site is http://www.xyz.com/index
.php it should now be
redirected to http://www.xyz.com/inde
x.aspx
Also the hosting company would be changing & there is no
support for
php on the new server. I was wondering if anyone can help me
with the
redirection in this situation.
Thanks in advance
Subrato


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "ASP.Net Community" group.
To post to this group, send email to aspnetgooglegroups.com
To unsubscribe from this group, send email to
aspnet-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/aspnet?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Redirection
country flaguser name
United States
2007-03-28 17:13:38
So... are you trying to redirect from PHP or from ASP?

Redirection can be achieved using Response.Redirect(page
url) through
ASP.NET.  I don't use PHP personally, but my sources tell me
that you
can achieve the same thing using:
<?php
header( 'Location: http://www.your
site.com/new_page.html' );
?>

But there is an easier way!

If you're using something like IIS or Apache and you can get
your paws
on some configuration settings, you can change the page that
it
recognises as the index to that directory to only be ones
you want
(i.e. index.aspx or main.aspx, but not index.php).  That way
you can
just go to "mySite.com" and it will automatically
load your index.aspx
page rather than your index.php page.

Hope this helps!

Kris Rhodes
----
CRM 3.0/VB.NET programmer
Quantum Business Technology
Perth  West Australia

This post is to be used as advice and advice only.
On Mar 29, 3:40 am, "Subrato"
<mukherjeesubr...gmail.com> wrote:
> Hi,
>   I am new to asp.net as such. I have this problem of
redirecting
> pages. The old site was php and now has been redesigned
using asp.net.
> I was assigned a task to put redirections for 25 most
viewed pages. So
> if the site ishttp://www.xyz.com/ind
ex.phpit should now be
> redirected tohttp://www.xyz.com/inde
x.aspx
> Also the hosting company would be changing & there
is no support for
> php on the new server. I was wondering if anyone can
help me with the
> redirection in this situation.
> Thanks in advance
> Subrato


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "ASP.Net Community" group.
To post to this group, send email to aspnetgooglegroups.com
To unsubscribe from this group, send email to
aspnet-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/aspnet?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Redirection
country flaguser name
United States
2007-03-30 07:02:49
Sounds like you need redirection from either the PHP page
(which you
mentioned previously that the new host will not have PHP
access) so
the next best thing is see whether you can sort out a custom
404 error
page.  I'm not really familiar with how the 404 error page
works, but
it should at least have the environment variable that tells
you where
the page came from last.  Delete the old pages off the
server, it will
go to the 404 error page because the resource is not found
and read in
the referring URL.  Either trim "php" off the end
of the URL or use
the string replace ".php" with ".aspx"
(the 2nd method will allow you
to use query strings as well with your URLs).  I would also
add in a
little "catch" statement to display an error if it
originated from the
404 page, tried to redirect and failed.

That is how I would do it, or at least the approach I would
take.
Unfortunately most of my solutions involve either having PHP
support
or access to the server configuration, both of which may not
be
available to you.  Maybe if you ask really nicely...

Kris Rhodes
----
CRM 3.0/VB.NET programmer
Quantum Business Technology
Perth  West Australia

This post is to be used as advice and advice only.

Subrato wrote:
Kris,
      Thanks for the reply. The situation is little more
delicate than
this.
The reason I have to use redirection is I have to assume
that people
might
have bookmarked the pages. So if someone has a link like
http://www.xyz.com/h
ome/test.php I want to get them redirected to
http://www.xyz.com/
home/test.aspx I have the list of 25 most viewed
pages
and fortunately we have the same names for the pages as they
were for
php
site , the only difference they need to be aspx now.I tried
parsing
the
string and tried to get the new URL but it was getting
nowhere.

On Mar 29, 6:13 am, "Kris Rhodes" <rhode...gmail.com> wrote:
> So... are you trying to redirect from PHP or from ASP?
>
> Redirection can be achieved using
Response.Redirect(page url) through
> ASP.NET.  I don't use PHP personally, but my sources
tell me that you
> can achieve the same thing using:
> <?php
> header( 'Location:http://www.your
site.com/new_page.html');
> ?>
>
> But there is an easier way!
>
> If you're using something like IIS or Apache and you
can get your paws
> on some configuration settings, you can change the page
that it
> recognises as the index to that directory to only be
ones you want
> (i.e. index.aspx or main.aspx, but not index.php). 
That way you can
> just go to "mySite.com" and it will
automatically load your index.aspx
> page rather than your index.php page.
>
> Hope this helps!
>
> Kris Rhodes
> ----
> CRM 3.0/VB.NET programmer
> Quantum Business Technology
> Perth  West Australia
>
> This post is to be used as advice and advice only.
> On Mar 29, 3:40 am, "Subrato"
<mukherjeesubr...gmail.com> wrote:
>
> > Hi,
> >   I am new to asp.net as such. I have this problem
of redirecting
> > pages. The old site was php and now has been
redesigned using asp.net.
> > I was assigned a task to put redirections for 25
most viewed pages. So
> > if the site ishttp://www.xyz.c
om/index.phpitshould now be
> > redirected tohttp://www.xyz.com/inde
x.aspx
> > Also the hosting company would be changing &
there is no support for
> > php on the new server. I was wondering if anyone
can help me with the
> > redirection in this situation.
> > Thanks in advance
> > Subrato


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "ASP.Net Community" group.
To post to this group, send email to aspnetgooglegroups.com
To unsubscribe from this group, send email to
aspnet-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/aspnet?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )