Results 1 to 5 of 5

Thread: url redirecting

  1. #1

    Join Date
    Feb 2008
    Location
    Colombia
    Posts
    127
    Rep Power
    10

    url redirecting

    there is a forum about names and dns, but since this is not a domain name directing to my account, but rather directing directories to specific pages, here it goes:

    lets say i have an account like 'domain_name.com', and in this page, the starting point should be 'start_app_here.php'.

    the idea would be, if a user types in the browser 'domain_name.com', he or she will be redirected to 'domain_name.com/start_app_here.php', ideally, without showing the 'start_app_here.php' part in the browser url box

    now, in the control panel there is a section called htacces editor, and from there, there is a section called url redirect. i went there and there is a form with two boxes
    *one box is to enter the input url, or the input the user writes in his or her browser
    *the other box is to enter the redirect url, or the destination url when the input url is given

    since, what i want is that when user enters 'root' or '/', he or she will be redirected to 'start_app_here.php', i filled the boxes like

    input address: (blank), it is set to '/'
    redirect address: 'http:domain_name.com/start_app_here.php' (redirect url asks for full url)

    now, if after creating the redirect from the form provided in the powweb panel, i type the domain name in the browser, what i get is this:

    in the url box in the browser, the url reads something like:
    domain_name.com/start_app_here.phpstart_app_here.phpstart_app_here .phpstart_app_here.phpstart_app_here.phpstart_app_ here.phpstart_app_here.phpstart_app_here.php

    and in the content area, there is an error that reads something like (copy paste): The page isn't redirecting properly
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    so, how do i do this? powweb provides a format for this but it seems is of no use, how do i redirect a '/' to a 'start_here.php', if possible without showing the 'start_here.php' in the browser? how do i do the same with other pages, like 'domain_name.com/some_dir/' to 'domain_name.com/some_page.php'?
    tnx

  2. #2

    Join Date
    Feb 2008
    Location
    Colombia
    Posts
    127
    Rep Power
    10
    update: instead of redirecting from '/' to '/starthere.php', i set the default root file as 'start_here.php', and i see the redirect from subdirectories to specific pages is working, but it makes the redir file names visible, like if i write 'some_domain.com/page/', it will make visible the url 'some_domain.com/page.php', how do i avoid that?

    tnx

  3. #3
    Rick
    Join Date
    May 2002
    Location
    Minneapolis, MN
    Posts
    1,753
    Rep Power
    19
    I really don't understand what you're trying to do overall and I'm far from an .htaccess expert, but if you don't want users to see the 'start_here.php' filename, you want to do a plain rewrite, not a redirect.

    I believe it's best to avoid changing the normal handling of a domain's root URL without a very good reason because you can so easily end up in a situation where the website is inaccessible. I would suggest that you try to find a solution that works with /index.php rather than substituting a different file name.
    Rick Trethewey

  4. #4
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,457
    Rep Power
    22
    Also, try .htaccess Editor: Default Pages in OPS. I just set mine so the 'default page', the page that gets 'served first' when only the domain name is typed, was just a simple text file in my /htdocs directory. And only what is typed in the address bar is what is shown, not the full path.
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  5. #5

    Join Date
    Feb 2008
    Location
    Colombia
    Posts
    127
    Rep Power
    10
    hi, tnx for your answers. about snowmaker suggestion, that's what worked for the entry point of the app. the app still uses more entry points, for example, to register the entry page is different from the main page, also, the things that are called to load from ajax are called from a different location, so these other entry points are other chances to receive attacks. since the app is in php, i want to hide the page names; which i believe, can mitigate scripted attacks to some point (as if the script can not guess entry points, it can not attack these). About rewriting the app to fit the pages location, i accounted for that from the beginning. all code that spews urls, does it so from global vars or defines that contain the location, so if i want to change the address, i have to change it only once in one location, and all the code takes it from there. what i am thinking now is not to redirect from subdirs to some pages, but make those dirs and set the default entry pages of each dir as one of the urls i need

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •