Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

migrating site from jsp to php .. search engine issues

  • 11-02-2004 4:44pm
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    hi im migrating a site from jsp to php.
    suppose some one searches in google for something and come across this site.
    how long will google and the like keep the references for my jsp pages.

    what is the best way to combat the issue that those pages no longer exist.... leave the jsps and put a redirect to the corresponding php????

    tnx


Comments

  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Yes. Alternatively, if you're using Apache and the filenames are identical bar the extension, remap the URL's using mod_rewrite:

    (In the relevant VirtualHost...)
    RewriteEngine on
    RewriteRule (.+).jsp$ $1.php
    
    adam


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    my site is hosted by a hosting company... before asking them can you tell
    is that change made by me or the host??
    of can it be made at all as its a shared server??


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Depends on whether your account is a "virtual host" or a "virtual server". If you have root shell access it's a virtual server, and yes, you can make that change (prolly in /etc/httpd/conf/httpd.conf). If not, try placing the code above in a .htaccess file in the DocumentRoot of your website and see what happens. (If the site is live, copy a few JSP and PHP files into a temporary directory and try it there.

    Another option is to have PHP parse JSP files, again in httpd.conf or .htaccess:
    AddType application/x-httpd-php .php .jsp
    
    adam


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    You could also use a redirect in .htaccess , but this would depend on your host


  • Registered Users, Registered Users 2 Posts: 252 ✭✭ConsultClifford


    blacknight,
    i have that exact issue also... ill be migrating a jsp site to php shortly... and its hosted with you.
    do i have access to .htaccess ?

    tnx


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    Originally posted by ConsultClifford
    blacknight,
    i have that exact issue also... ill be migrating a jsp site to php shortly... and its hosted with you.
    do i have access to .htaccess ?

    tnx

    In a word - YES :D

    If you have any issues with directives let us know.


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    ill have to check with my host also.

    however does this redirect you guys mention mean that if i try to access www.foo.com/test.jsp then it will actually give me www.foo.com/test.php

    tnx


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    You can do either

    It depends on what you want to do.
    If you use a nice bit of Apache's mod_rewrite you can even do it so that the visitor is completely oblivious to the change


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    The RewriteRule above will do it transparently. If you want to make it obvious, add " [L,R]" (minus the quotes) to the end of the RewriteRule.

    adam


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    after reading some other threads ie. that naming html files descriptively is very good practice for search engines(is this true?)....

    i think i will not only be changing the jsp to php but for several files i will rename them. is it true therefore that much of what we ve said goes out the window... as if someone searches for foo.jsp but now its foodescription.php our redirects will do nothing!

    can we basically do some sort of redirect saying if the user requests any jsp page they re direct them to the index.php


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    Yes.

    For example, we converted our entire site to php about 18 months ago (maybe more), but as the search engines had indexed all the .html pages we put a .htaccess redirect


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    RewriteEngine on
    RewriteRule .+\.jsp$ / [L,R]
    


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    tnx alot
    btw what does shell access really mean?


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Means you get to ssh or telnet into the machine, like the command prompt in Windows.

    adam


  • Closed Accounts Posts: 14,483 ✭✭✭✭daveirl


    This post has been deleted.


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Originally posted by daveirl
    if you do a rewrite does google drop the old address from the index, or do you have to do redirect 301 to do that?
    We never know what Google does. However Apache sends a 302 (Moved Temporarily) if the RewriteRule is followed by an [R] flag, so it's probably better to use [R=301] and cross your fingers.

    If you don't send an R flag, Google will get a 200 and won't see any difference.

    adam


  • Registered Users, Registered Users 2 Posts: 252 ✭✭ConsultClifford


    could anyone gimme a link where i can go to learn about ssh so i can sort this thing out?

    cheers


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    Originally posted by ConsultClifford
    could anyone gimme a link where i can go to learn about ssh so i can sort this thing out?

    cheers

    What do you need to know?

    http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=unix+commands - common commands

    http://www.chiark.greenend.org.uk/~sgtatham/putty/ - windows client


  • Registered Users, Registered Users 2 Posts: 19,396 ✭✭✭✭Karoma


    i'm going a little off topic,sorry. but,..
    why are you changing from jsp to php?

    </curiosity>


Advertisement