Azure codeigniter error: does not access subfolders

Asked

Viewed 86 times

1

inserir a descrição da imagem aqui

I have an Ecommerce system hosted on Azure( http://lojavirtualcodeigniter1.azurewebsites.net/) Developed in Codeigniter Framework 1.7.2 The system is loaded in index. However, I cannot load the other url that are in the subfolders: Contact, Adm, Cart....

My . htaccess :

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

I’ve already set up the files:

  • config.php (base(). url)
  • database.php (related to)
  • autoload.php (url)

Have any other settings to be made, in Azure or codeigniter ?

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

1 answer

1


Resolution:

  1. Remove the . htacces file from the system as in Azure it is not used
  2. Create the file with web config. with this code(insert into the project root folder). It will allow access to the pages by the friendly urls:

<?xml version="1.0" encoding="UTF-8"?>
     <configuration>
        <system.webServer>
             <rewrite>
                 <rules>
                     <rule name="Clean URL" stopProcessing="true">
                         <match url="^(.*)$" />
                         <conditions>
                             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                         </conditions>
                         <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
                     </rule>
                 </rules>
             </rewrite>
         </system.webServer>
     </configuration>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.