Results 1 to 5 of 5

Thread: CMS help

  1. #1

    CMS help

    I'm trying to code mod_rewrite url maker for my small website.

    Here an example of what I want done.

    Admin posts a url into a field names PHP URL.
    Once the admin clicks submit, the script generates a mod_rewrite url.

    Once this is done,

    Is that possible?

    P.S. it would be great if there's some type of drop-down that lets you specify how many PHP URL fields you want to submit, so that people don't have to it one by one.

    My thoughts is that this is impossible, because it requires writing onto the .htacess, which, though I have not researched this, I think is impossible. If it is, is there still someway to make the mod_rewrite automatic so I don't have to enter in each line manually?
    Last edited by ethereality; 08-01-2005 at 08:59 PM.

  2. #2
    Anyone? (Gosh, I wish that 15 minute edititng restriction was taken away)

  3. #3
    Join Date
    Jul 2003
    You can adjust mod_rewrite so it works for any url in the form /somecat/someid -- so you don't have to worry about writing rules for every possible combination.

    Also, there is no restriction in opening up and writing to .htaccess files.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  4. #4
    Join Date
    Dec 2004
    New York City, NY, USA
    I'm not understanding why you need to be writing URLs out to .htaccess... (maybe you want to do some heavy customization you're not telling us).

    The easiest way to use mod_rewrite is to define a SINGLE rule that will take any URL in some format:

    and convert to a GET-like request:

    If you're wanting do something like highly customized, such as having a URL such as:

    I'd use some general mod_rewrite rule that would go to some script, which would look up in a database what the real URL was, rather than doing something possibly haphazard such as writing to .htaccess directly. Too many mod_rewrite rules can slow performance down a lot as well.

  5. #5
    Yeah, I figured out how to get this. My source of information for having to write out each and every URL didn't know you can use the RewriteRule ^tutorials/(.*)/(.*) /tutorials.php?category=$1&id=$2 code to make it automatically do what I wanted.

Posting Permissions

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