www.webdeveloper.com
Results 1 to 2 of 2

Thread: Problems with mod_rewrite

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Posts
    6

    Unhappy Problems with mod_rewrite

    Hello, I'm new here.

    I have some problems with .htaccess ( mod_rewrite ).

    I'm traying to make nice links and use mod_rewrite. how ever its ont working how I expected.

    I have 3 RewriteRuls that and I want to seperet them with a RewriteCond.

    This is my .htacchess:
    Code:
    Options +FollowSymLinks
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} name=(.*)&sec=(.*)
    RewriteRule ^(.*)-(.*)$ showsec.php?name=$1&sec=$2 
    
    RewriteCond %{QUERY_STRING} name=(.*)&cat=(.*)
    RewriteRule ^(.*)-(.*)$ showcat.php?name=$1&cat=$2 
    
    RewriteCond %{QUERY_STRING} name=(.*)&id=(.*)
    RewriteRule ^(.*)-(.*)$ showone.php?name=$1&id=$2
    And it doesn't work, I think I'm making something wrong...
    For now I'm woking on wamp. the htaccess is located in: www/subfolder/.htaccess
    and the files are in the subfolder to.

    What I want is that the first rule is appled only if a sec variable exists, the second if a cat variable exsists and the thirs if id exists.

    So if anyone can help mi with that :, I'm trying this for 3 days and can't get it right...

    And shuld i put the .htacces in the www directory, or can it be in the subfolder. ( I'll have more subfolders later, so if in eatch can be one htaccess for rewriting for the subfolder its in... )

    Srry, for band Englsih

  2. #2
    Join Date
    Jun 2011
    Posts
    6
    No one ?
    I managed to make it work by adding some text to eatch rewrite rule so it knows what rule to use, but thats not the right solution

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles