SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist luxinterior's Avatar
    Join Date
    Aug 2004
    Location
    Here, there and everywhere!
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    htaccess to redirect root of folder

    Hi

    I want to prevent people from going to the root of a folder without preventing the execution of the page.

    To explain further.

    I have an index page in a folder called 'books' and the index page should always be 'index.php?Operation=ItemSearch&Keywords=oprah&SearchIndex=Books&ItemPage=1'

    What I want to prevent is somebody being nosy and takeing the parmanters off and just running index.php.

    Can I do with a .htaccess in the folder and if so how?

    Thanks

    Lux

  2. #2
    SitePoint Member dtannen's Avatar
    Join Date
    Feb 2005
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in folder books, make a file called .htaccess. In it put:

    Code:
    RewriteEngine on
    
    RewriteRule ^(index.php)$       /index.php?Operation=ItemSearch&Keywords=oprah&SearchIndex=Books&ItemPage=1
                     [L]
    David - Web Developer and Entrepreneur

    datingfails.com
    Bad Dates. Great Stories.

  3. #3
    SitePoint Evangelist luxinterior's Avatar
    Join Date
    Aug 2004
    Location
    Here, there and everywhere!
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response David. I did what you suggested and at first it appeared to work. The problem is now that EVERY file points back to the first page not just index.php. Here's the full .htaccess file. Hopefully you can spot what it is easily

    RewriteEngine On
    RewriteRule ^index.html$ index.php

    RewriteRule ^(index.php)$ index.php?Operation=ItemSearch&Keywords=oprah&SearchIndex=Books&ItemPage=1 [L]

    RewriteRule ^(.*)/(.*)-search-(.*)-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4&ItemPage=$5 [QSA,L]
    RewriteRule ^(.*)/(.*)-search-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4 [QSA,L]
    RewriteRule ^(.*)/(.*)-search-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3 [QSA,L]
    RewriteRule ^(.*)/browse-(.*)-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3&ItemPage=$4 [QSA,L]
    RewriteRule ^(.*)/browse-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3 [QSA,L]
    RewriteRule ^(.*)/browse-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2 [QSA,L]
    RewriteRule ^(.*)/(.*).html index.php?Operation=ItemLookup&ItemId=$1 [QSA,L]
    RewriteRule ^(.*).html?$ index.php?SearchIndex=$1 [QSA,L]

    Regards

    Lux

  4. #4
    SitePoint Member CoreDesign's Avatar
    Join Date
    Feb 2005
    Location
    UK
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CRONserve

    This message doesn't belong in this forum because I can't find the forum it belongs to.

    See the attached image - you've got my email addy or your can pm me.

    I did the top scheme at the moment to set the overall feel for how the site
    might look. More importantly, alot of the link banners you've got 'clash' with
    each other let alone how they'll look in a new environment. Maybe the sites
    you link to can give you new artwork to use?

    I've got vector files for the credit cards, and I know Paypal have got a few
    logo variations so I'll see which one looks best unless you want to find another.

    The Live Support link banner I'll re-do to match the site. The free Digital TV,
    I'll have the TV... but I think the Ad needs a once over - let me know.

    I'd also suggest refraining from any animated gif ad's - if they're not yours
    then they're distracting attention unnecessarily. Let me know, I'll flatten
    them out.

    Have you got any clues as to the building pic that'll be incorporated? I can
    get one if you brief me one the style, shape, color etc...

    G'nite
    Attached Images Attached Images


Bookmarks

Posting Permissions

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