+ Reply to Thread
Results 1 to 2 of 2

Thread: another .htaccess question into the mix

  1. #1

    Default another .htaccess question into the mix

    I've currently got a site in development that I'd liek to implement .htaccess mod rewrite on. Being in development, it's not an addon domain yet, it's simply in the sub directory of my domain.

    example:
    domain.com/websitename/

    And I have a program called browse.php inside of the folder:

    domain.com/websitename/content/

    I wanted to rewrite:


    So my .htaccess INSIDE of /content/ looks like this:

    RewriteEngine On
    RewriteRule ^/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+) browse.php?view=$1&abc=$2&id=$3
    ...But doesn't work. Also, some occasions won't have an id, or an abc. Will this still work out?

  2. #2
    Join Date
    May 2006
    Location
    Maryland
    Posts
    192

    Default

    This might work:
    Code:
    RewriteRule ^(.*)/browse.php\?view=&([^/=&]+)=&([^/=&]+)$ \
                $1/viewvar/$2var/$3var/ [L]
    Some notes:

    I broke it in half with a 'backslash to make it easier to see on this page, but I'm not sure if you can do that in .htaccess for real.

    If this .htaccess file is in the /websitename/content/ directory, it will not be used in comparisons in /websitename/, so you can be generic with '(.*)' with no danger.

    The '?' character is special, so you must escape it to match it.

    Your example shows '=&'. Is that right? Do you really want '&'?

    I added '[L]' (for last) to indicate that no further tests are to be performed if you get a match. It's optional.

+ Reply to Thread

Posting Permissions

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