Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2004
    Location
    Denmark
    Posts
    21

    Modul Rewrite, htaccess job

    I've heard its possible via htaccess, Modul Rewrite , to change a dynamic url like

    http://mw/?id=3

    to a static like

    http://mw/3/ or http://mw/3.html

    Im especially interested in changing all of my dynamic urls to a static URL, with the extension of .html, like http://mw/3.html

    Im looking for someone who would be able to do this.
    This would ofcause be a paid job ($$$ or advertising on my site), but as I dont know the range of how demanding this task is, I would like to know what you would charge for such a task.

    Feel free to PM me or respond to this thread.

  2. #2
    Join Date
    Nov 2003
    Location
    Florence, KY
    Posts
    604
    This could be done with a redirect in an index.cgi file

    PHP Code:
    use CGI;
    my $q = new CGI;
    my $id $q->param("id");

    print 
    "Location: [url]http://[/url]".$ENV{SERVER_NAME}."/".$id.".html\n\n"
    Call this file index.cgi and chmod 755 it and you should be able to call it with:

    http://wht/?id=3 and have it redirect to http://wht/3.html as long as you have index.cgi setup in the DirectoryIndex of apache.

    Justin

  3. #3
    Join Date
    Jan 2004
    Location
    Denmark
    Posts
    21
    hey thanks. ill have to try that out ..

    But im pretty sure thats not how I want it to work ..
    I dont want it to redirect, I want it to appear as a static .html at all time .. I know its possible to do via Modul Rewrite.

    Thanks for the effort anyways

  4. #4
    Join Date
    Nov 2003
    Location
    Florence, KY
    Posts
    604
    Ok try this in an htaccess file:

    PHP Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase 
    /
    RewriteRule ^r/(.*)                /$1.html [P]
    </
    IfModule
    This will make http://wht/r/3 pull up the page http://wht/3.html . Is that something like you are looking for?

    Justin

  5. #5
    Join Date
    Jan 2004
    Location
    Denmark
    Posts
    21
    Yea something like that...

    I have a url like http://wht/test.php?id=3

    and I want it to appear like

    http://wht/3.html

    Not sure if the above will do that ?
    The coder of our site is not around, but ill have to try and see if I can figure it out myself

  6. #6
    Join Date
    Dec 2003
    Posts
    936
    I can do this for you
    Primary email: advanced dot programmer at gmail dot com ..

  7. #7
    Join Date
    Jan 2004
    Location
    Denmark
    Posts
    21
    Got it figured out .. Thanks to everyone showing interest..

Posting Permissions

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