Needs some help with an apache mod-rewrite issue

后端 未结 1 1645
终归单人心
终归单人心 2021-01-27 03:24

I\'ve modified my .htaccess file to have the following statement

RewriteCond $1 !^index.php$
RewriteRule ^/?([^/]+)$ index.php?c=home&m=details&seo=$1 [L         


        
1条回答
  •  梦毁少年i
    2021-01-27 03:56

    If you want files to trump products you could toss in another condition:

    RewriteCond $1 !^index.php$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/?([^/]+)$ index.php?c=home&m=details&seo=$1 [L,NS]
    

    ...meaning that only if the requested URI doesn't map to a file should it be treated as a product.

    Having files trump products like this isn't terrible unless you plan on having products with names like "something.html" and "dynamic.php" or "lenna.jpg".

    0 讨论(0)
提交回复
热议问题