Skip to main content
added 89 characters in body
Source Link
miken32
  • 42.5k
  • 16
  • 127
  • 177

Note: This introduces very significant security issues and is not recommended.

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public folder to root folder (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public folder to root folder (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

Note: This introduces very significant security issues and is not recommended.

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public folder to root folder (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

editted to remove a little ambiguity in answer
Source Link

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public folder to root folder (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public folder to root folder (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

added 101 characters in body
Source Link
ka_lin
  • 9.4k
  • 6
  • 39
  • 58

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

I have solved the issue using 2 answers:

  1. Renaming the server.php to index.php (no modifications)

  2. Copy the .htaccess from public (like rimon.ekjon said below)

  3. Changing .htaccess it a bit as follows for statics:

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC] 

If there are any other static files needed just add the extension to the previous declared list

Source Link
ka_lin
  • 9.4k
  • 6
  • 39
  • 58
Loading