Hello I have the following problem: I have some pages (php includes) which I load them like this
http://www.domain.com/news/
they work perfect. But if I remove the trailing slash
http://www.domain.com/news
this happens -> http://www.domain.com/news/?page=news&request=
Here are my htaccess rules:
RewriteEngine on
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl|jpg|png|gif)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)(.*)$ /index.php?page=$1&request=$2
PS. Could it by because I have a news folder in the root document as well ?
Yes, it’s because you have a
news/folder in the root. Your Rewrite Condition is looking for anything that isn’t a file (i.e.!-f) or a directory (!-d). Try renaming yournews/directory in the root.If you must, you can force
domain.com/newsto rewrite todomain.com/news/by doing the following: