Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Well i have this code into my .htaccess file

  Options +FollowSymlinks
    RewriteEngine on

    AddDefaultCharset UTF-8
    RewriteCond %{THE_REQUEST} ^[A-Z]+\ (.+)\.php  [NC]
    RewriteCond %{THE_REQUEST} !/?admincp/?((.)|(\.)*)
    RewriteRule [^/php/error\.php] /php/error.php  [L,NS]

    # Otherwise check if root request and rewrite to /php/index.php
    RewriteRule ^(/?)$ /php/index.php  [L,NS]
    RewriteCond %{THE_REQUEST} !\.php$  [NC]
    RewriteCond %{REQUEST_URI} !/?admincp/?((.)|(\.)*)
    RewriteRule ^([a-z|_]+)/?$ /php/index.php?categorie=$1 [L,NC,NS]
    RewriteCond %{THE_REQUEST} !\.php$  [NC]
    RewriteCond %{REQUEST_URI} !/?admincp/?(.*)
    RewriteRule ^([a-z|_]+)/([a-z|_|0|1|2|3|4|5|6|7|8|9]+)/?$ /php/index.php?categorie=$1&subcategorie=$2 [L,NC,NS]
    RewriteCond %{REQUEST_URI} !/?admincp/?(.*)
    RewriteCond %{THE_REQUEST} !\.php$  [NC]
    RewriteRule ^([a-z|_]+)/([a-z|_|0|1|2|3|4|5|6|7|8|9]+)/([^/]+)\.html$ /php/index.php?categorie=$1&subcategorie=$2&article=$3 [L,NC,NS]
    ErrorDocument 404 /php/index.php?categorie=apps&subcategorie=error404

I am trying to change line 6 to this:

  RewriteRule [^/php/index\.php\?categorie=apps&subcategorie=error404] /php/index.php?categorie=apps&subcategorie=error404  [L,NS]

but it doesn't work.. When i type http://localhost/php/index.php i see this page, but i don't want to see this page..I want to see http://localhost/php/index.php?categorie=apps&subcategorie=error404

Any help?

share|improve this question
    
This should be line 7 if you are counting blank lines! Is that right? –  Khaled Jan 2 '12 at 15:13
    
@Khaled yes!!of course –  user726730 Jan 2 '12 at 15:20
    
Any advice guys? –  user726730 Jan 2 '12 at 15:33

1 Answer 1

I think the rule should be:

RewriteRule !/php/index\.php\?categorie=apps&subcategorie=error404  /php/index.php?categorie=apps&subcategorie=error404  [L,NS]

The pattern [^...] means any single character except the ones listed after ^. The ! means negate the entire pattern.

share|improve this answer
    
Internal Server Error thx for the response –  user726730 Jan 2 '12 at 17:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.