O
O
Oleg Lysenko2017-03-20 20:53:50
Apache HTTP Server
Oleg Lysenko, 2017-03-20 20:53:50

Htaccess redirect issue?

Hello, there is a project on the yii framework, it has a folder that contains a separate project with its own repository. When I go to project.local/folder , everything is OK and I get to the subdirectory with the project, when I go to project.local/folder/search , for example, everything, I get to the main project, htaccess tried to configure differently, but nothing comes out, I enclose the rules

RewriteEngine on
ErrorDocument 404 /error404.html

<IfModule mod_deflate.c>
    #The following line is enough for .js and .css
    AddOutputFilter DEFLATE js css

    #The following line also enables compression by file content type, for the following list of Content-Type:s
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml

    #The following lines are to avoid bugs with some browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
  <FilesMatch "\.(js|css|xml|gz)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>
<ifmodule mod_expires.c>
<Filesmatch "\.(jpg|jpeg|png|gif|js|css|swf|ico|woff|mp3)$">
    ExpiresActive on
    ExpiresDefault "access plus 2 weeks"
</Filesmatch>
</ifmodule>

RewriteBase /
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteCond %{REQUEST_URI} !rdf [NC]
RewriteRule ^(.*)(/)$ $1 [L,R=301]

# if a directory or a file exists, use it directly
#RewriteCond %{REQUEST_URI}  !\.(png|jpe?g|gif|jpeg|bmp|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d #commented cuz rdf/ dosen`t wor

# otherwise forward it to index.php
RewriteRule . index.php

RewriteRule ^folder/(.*)$ /folder/$1 [R=301,L]
It should seem to work, but it doesn't want to ...
Thanks in advance for your help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question