Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess RewriteRule doesn't work
    primarykey
    data
    text
    <p>I am working in yii framework and try to rewrite url using htaccess file this is my file (at first step I am trying to work with a simple rule) </p> <pre><code>RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^carguide$ MainModel/index/304 [NC,L] # otherwise forward it to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php # otherwise forward it to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php </code></pre> <p>I want to rewrite url carguide to mainModel/index/304, but no meter what i tried the yii receive the orliginal url and raise 404 error. </p> <p>here is the log file: </p> <pre><code>strip per-dir prefix: C:/xampp/htdocs/cars/carguide -&gt; carguide applying pattern '^carguide$' to uri 'carguide' RewriteCond: input='C:/xampp/htdocs/cars/carguide' pattern='!-f' =&gt; matched RewriteCond: input='C:/xampp/htdocs/cars/carguide' pattern='!-d' =&gt; matched rewrite 'carguide' -&gt; 'MainModel/index/304' add per-dir prefix: MainModel/index/304 -&gt; C:/xampp/htdocs/cars/MainModel/index/304 strip document_root prefix: C:/xampp/htdocs/cars/MainModel/index/304 -&gt; /cars/MainModel/index/304 internal redirect with /cars/MainModel/index/304 [INTERNAL REDIRECT] add path info postfix: C:/xampp/htdocs/cars/MainModel -&gt; C:/xampp/htdocs/cars/MainModel/index/304 strip per-dir prefix: C:/xampp/htdocs/cars/MainModel/index/304 -&gt; MainModel/index/304 applying pattern '^carguide1$' to uri 'MainModel/index/304' add path info postfix: C:/xampp/htdocs/cars/MainModel -&gt; C:/xampp/htdocs/cars/MainModel/index/304 strip per-dir prefix: C:/xampp/htdocs/cars/MainModel/index/304 -&gt; MainModel/index/304 applying pattern '.' to uri 'MainModel/index/304' RewriteCond: input='C:/xampp/htdocs/cars/MainModel' pattern='!-f' =&gt; matched RewriteCond: input='C:/xampp/htdocs/cars/MainModel' pattern='!-d' =&gt; matched rewrite 'MainModel/index/304' -&gt; 'index.php' add per-dir prefix: index.php -&gt; C:/xampp/htdocs/cars/index.php strip document_root prefix: C:/xampp/htdocs/cars/index.php -&gt; /cars/index.php internal redirect with /cars/index.php [INTERNAL REDIRECT] strip per-dir prefix: C:/xampp/htdocs/cars/index.php -&gt; index.php applying pattern '^carguide$' to uri 'index.php' strip per-dir prefix: C:/xampp/htdocs/cars/index.php -&gt; index.php applying pattern '.' to uri 'index.php' RewriteCond: input='C:/xampp/htdocs/cars/index.php' pattern='!-f' =&gt; not-matched pass through C:/xampp/htdocs/cars/index.php </code></pre> <p>I tried to change the flags, add a RewiteBase.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload