Results 1 to 2 of 2

Thread: mod_rewrite freaks - I need your help!

  1. #1
    Join Date
    Apr 2005
    Posts
    1

    Arrow mod_rewrite freaks - I need your help!

    Hi!

    I have an URL like this:

    http://www.mydomain.com/index.php?_id=just-a-test

    I want to rewrite this into the following:

    http://www.mydomain.com/just-a-test.html

    My .htaccess file looks like this:

    Code:
    php_flag allow_call_time_pass_reference on
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([^-]+)-(.+)\.html$ index.php?_id=$1&_news=$2 [L] 
    RewriteRule ^(.+)\.html$ index.php?_id=$1 [L]
    The problem is:

    http://www.mydomain.com/index.php?_id=just-a-test
    becomes:
    http://www.mydomain.com/das.html ("a-test" is missing...)

    All hyphens and parameters get lost ... what am I doing wrong? :roll:

    I'm looking forward to your replies!

    Thank You very much!

    P.S. My Apache version is: Apache/2.0.50 (Linux/SUSE).

  2. #2
    Join Date
    Oct 2005
    Posts
    4
    Try something like this:

    Code:
    php_flag allow_call_time_pass_reference on
    RewriteEngine On
    RewriteRule ^(.+)\.html$ index.php?_id=$1 [QSA,L]
    This will also pass any other query string information so that if you had a URL like:

    The query string information would be passed.

Posting Permissions

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