0

I have a problem with making friendly URL. I need to convert url from http://blabla.eu/stats_details?date=01-2012 to http://blabla.eu/stats_details/01-2012. Other Rewrite rules are working properly beside the last one. What is the problem?

Here is code of .htaccess:

AddDefaultCharset utf-8

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^admin/users/$    /admin/users/view.php [L]
RewriteRule ^admin/loans/$    /admin/loans/view.php [L]
RewriteRule ^stats_details/(.*)$ stats_details.php?date=$1 [L,QSA]
</IfModule>
tshepang
  • 12,111
  • 21
  • 91
  • 136
Viktor M.
  • 4,393
  • 9
  • 40
  • 71
  • You say it should rewrite to stats_details?date=01-2012, in your RewriteRule you rewrite it to stats_details.php?date=01-2012 – Koen Geeraert Aug 18 '12 at 17:04
  • How is that possible? Other rules, for example, url /admin/users/view.php will be rewrited to admin/users that is to say left side of rewrite rule asks for final friendly url, right side for original url. Why did you decide so? – Viktor M. Aug 18 '12 at 17:10
  • Re-read your opening question please, it just might be that you have typed a mistake. – Koen Geeraert Aug 18 '12 at 17:14
  • Cannot understand why does it happen and how to fix it. Try a lot of variants to do it but the same result. Maybe, someone can find an error in the code. – Viktor M. Aug 18 '12 at 19:30

1 Answers1

0

I think this must to work, try to paste

RewriteEngine On RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]        

Felix
  • 1