htaccess rewrite url question

I have a few urls set up like this within zenphoto eg

http://www.mydomain.com/zen/index.php?p=credit
http://www.mydomain.com/zen/index.php?p=about

does anybody know what to put in the htaccess file so that it'll make the urls like:

http://www.mydomain.com/zen/credit/
http://www.mydomain.com/zen/faq/

I tried looking through the forums search, but I couldn't find anything relevant though I think I may have been phrasing my search requests right. any help would be greatly appreciated!!?

Comments

  • You could try the following:

    `

    Options +FollowSymlinks

    RewriteEngine on

    RewriteRule ^zen/(.+)/ index.php?p=$1 [nc]

    `

    Maybe you need to delete the first line - I use it depending on how my server is setup.

    Code above was inspired by: http://corz.org/serv/tricks/htaccess2.php
  • trisweb Administrator
    I actually have a rule for that in the latest SVN code --

    `RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA]`

    Add it to your .htaccess and they'll be accessible through /page/credit and /page/about respectively.
  • thanks!
  • I am confused by Zenphoto's modrewrite facilities. Is the install/admin section supposed to create the htaccess files for us or do we have to do it all for ourself?
  • trisweb Administrator
    You have to edit the one included in the package. If you can't find it, you're probably on a mac/linux system, and it's hidden. It's in the download, you just have to find it :)

    Also, that rewrite rule up there actually won't work... let me find the real one... ah, here:

    `RewriteRule ^page/([A-Za-z0-9-]+)/?$ index.php?p=$1 [L,QSA]`

    That should allow you to access pages by /zen/page/pagename
  • >> If you can't find it, you're probably on a mac/linux system, and it's hidden. It's in the download, you just have to find it :)

    I misread the intructions and ended up overwriting the delivered htaccess with a one line one of my document root! Cheers for the help!
  • How would you change .htaccess so that
    ```zenroot/customPage/`
    translates to
    ```index.php?page=customPage`

    (I would like not to have to have /page/customPage).
    Do you have to define each custom page?

    Thanks for your help.

    - Donki
  • I have a few urls set up like this
    http://itweb.mydomain.com
    http://roltaweb.mydomain.com
    http://helpdesk.mydomain.com

    does anybody know what to put in the htaccess file so that it'll make the urls like:

    http://itweb
    http://roltaweb
    http://helpdesk

    I tried looking through the forums search, but I couldn't find anything relevant though I think I may have been phrasing my search requests right. any help would be greatly appreciated!!?
  • acrylian Administrator, Developer
    This is not possible at all as you always need a top level domain, the ".com" in this case. This is not a Zenphoto limitation!
Sign In or Register to comment.