Codeigniter app .htaccess set to remove index.php but it displays index.php for a single page that it is redirected to

I have a site that runs a codeigniter app. I have the htaccess set to force https and that is working but I am having a slight problem with the removal of the index.php from some of the urls.

When I visit the main site it works as expected

I but I have a page that is for uploading files site.com/Home/uploadFiles that redirects to a login page site.com/Home/authenticateUser when the user is not logged in and it for some reason reverts to site.com/index.php/Home/authenticateUser

but once logged in it transfers me to the upload at site.com/Home/uploadFiles

I can still visit the direct page site.com/Home/authenticateUser and there will be no index.php so I’m not sure what is happening here it just seems to be that redirect that is the issue but its weird its only that one.

Here is my .htaccess

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} (L,R=301,NE) 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 (L)

apache 2.4 – .htaccess: Remove everything after ‘/index.php’

I’ve spent hours looking for the ultimate way to optimize my URLs in a way they cannot break the pages and their structure.

I first needed a way to remove the trailing slash at the end of the URL – resolved! website.com/index.php/ used to be a problem but now the / at the end of the URL is gone, no matter what!

Then I found out that directories themselves can also cause problems. So I had to find a way to turn something like website.com/page///// to website.com/page/. No extra slashes. Resolved!

Now, I jumped onto the next problem. Putting something after website.com/index.php will cause problems. For instance: website.com/index.php/index.php or website.com/index.php/abc will not throw you a 404 error but you will remain at the current page with all the URLs (for stylesheets and scripts) broken. Which… is not good.

I actually found a few similar problems out there but none of them really helped me resolve this case. Any help would be appreciated!

.htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 (L,R=302)

RewriteCond %{THE_REQUEST} //
RewriteRule ^.*$ $0 (R=302,L,NE)

debian – removing index.php from URL

I am running a wordpress site with Astra theme.

I use the custom permalinks and I would like to remove index.php from url.

I have the following .htaccess file:

# BEGIN WordPress                                                                                                                                                                                          
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are                                                                                                                                 
# dynamically generated, and should only be modified via WordPress filters.                                                                                                                                
# Any changes to the directives between these markers will be overwritten.                                                                                                                                 
<IfModule mod_rewrite.c>                                                                                                                                                                                   
RewriteEngine On                                                                                                                                                                                           
RewriteBase /                                                                                                                                                                                              
RewriteRule ^index.php$ - (L)                                                                                                                                                                             
RewriteCond %{REQUEST_FILENAME} !-f                                                                                                                                                                        
RewriteCond %{REQUEST_FILENAME} !-d                                                                                                                                                                        
RewriteRule . /index.php (L)                                                                                                                                                                               
</IfModule>                                                                                                                                                                                                
                                                                                                                                                                                                           
# END WordPress                                                                                                                                                                                            

At this point, if I still have index.php in my URL, I think that the .htaccess file is ignored by apache. This is my /etc/apache2/apache2.conf setting:

<Directory /var/www/wordpress/>
  Options Indexes FollowSymLinks
  AllowOverride All
  Allow from All

  Require all granted
</Directory>

All is granted and I can do whatever garbage in my .htaccess file, it does nothing.

I put garbage also in the but still nothing changed.

My Module rewrite is already enabled.

Thank you for your help.

Nginx root(/) location proxy_pass not loading index.php

I am setting up two websites and both the websites are running on separate apache servers. 1 is mydomain.com and 2 is mydomain.com/abc/
mydomain.com is hosted on Server A 192.168.10.10
and mydomain.com/abc is hosted on Server B 192.168.10.11
, top of this I have set up one Nginx reverse proxy that has public IP.
My Issue is – I have set up one index.php under /var/www/html/index.php and in this php file I added one condition like if mydomain.com got hit outside from my country then it loads mydomain.com else it loads mydomain.com/abc and by using the below configuration my index.php file is not loading it directly redirecting to mydomain.com, I think I need to make changes in location / but what changes I don’t know
looking for your help

my Nginx configuration

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    index index.php;
    server_name mydomain.com www.mydomain.com;

   location = / {
           root /var/www/html;
           index index.php;

           try_files $uri $uri/ =404;
            proxy_pass http://192.168.10.10;
    }

    location /abc {
            index index.php;
            proxy_pass http://192.168.10.11:8080/abc/index.html;
            }

    location ~ .php$ {
     include snippets/fastcgi-php.conf;
     fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }
    }

Thanks in advance

Como quitar el “index.php” de la URL en un proyecto Laravel en una instancia EC2 Ubuntu 20.04

He creado una instancia EC2 Ubuntu 20.04 para allĂ­ cargar un proyecto de Laravel, localmente el .htaccess me funciona con normalidad, sin embargo, cuando subo el proyecto a la instancia no logro quitar el index.php de la ruta

este es el .htaccess cargado

Options -MultiViews -Indexes

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - (E=HTTP_AUTHORIZATION:%{HTTP:Authorization})

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 (L,R=301)

# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php (L)

Cuando se accede a la ruta arroja el siguiente error

introducir la descripción de la imagen aquí

magento2.4 – integrate WordPress functions into magento 2 store using WP-load function in magento root index.php

I have multi-site WordPRESS website. https://staging3.rocknetworks.com/. So, I need to include my WordPress header & footer in magento 2 (Fresh magento 2) https://staging3.rocknetworks.com/store2 website.

I have added the wp-load.php in magento 2 root index.php but it’s not working for me. https://prnt.sc/uc0o22

Basically I need to use wordpress functions in magento 2 template so that i can create use same layout like my WordPress.

On My live website in which I have setup magento 1 which is working fine. but it’s not working for magento 2.

mysql – Have Ubuntu 20 VPS on ex. index.php, but it’s 404 site

I am trying to remove all of this sql and then start again on mariadb, but it still sais warning and errors:

sudo apt remove mysql-server mysql-client mariadb-server mariadb-client
sudo apt auroremove mysql-server mysql-client mariadb-server mariadb-client
sudo apt purge mysql-server mysql-client mariadb-server mariadb-client
sudo apt update
sudo apt upgrade

There are full of errors here. See the four pictures (remove, auroremove, purge and upgrade): https://ibb.co/r6zcTDf, https://ibb.co/Xk7pPLk, https://ibb.co/KhLxPpw and https://ibb.co/khdgmJr.

commando:
/var/www/html/test.com/index.php //<?php phpinfo();

website https://test.com/index.php:
404 Not Found
nginx/1.18.0 (Ubuntu)

/var/log/mysql/error.log

(System) (MY-010910) (Server) /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
(System) (MY-010116) (Server) /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 28629
(System) (MY-011012) (Server) Starting upgrade of data directory.
(System) (MY-013576) (InnoDB) InnoDB initialization has started.
(ERROR) (MY-012936) (InnoDB) Database upgrade cannot be accomplished with innodb_force_recovery > 0
(ERROR) (MY-012930) (InnoDB) Plugin initialization aborted with error Generic error.
(ERROR) (MY-011013) (Server) Failed to initialize DD Storage Engine.
(ERROR) (MY-010020) (Server) Data Dictionary initialization failed.
(ERROR) (MY-010119) (Server) Aborting
(System) (MY-010910) (Server) /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).

I have innodb_force_recovery = 1 on /etc/mysql/mysql.conf.d/mysqld.cnf, but that didn’t help me.

Can you help me?

magento2 – Why is there an exit () directive at the beginning of my pub / index.php?

Here is the code of the pub / index.php:

error_reporting(E_ALL);
ini_set('display_errors', 1);

use MagentoFrameworkAppBootstrap;
use MagentoFrameworkAppFilesystemDirectoryList;
exit();

try {
    require __DIR__ . '/../app/bootstrap.php';
} catch (Exception $e) {
    echo <<
    

Autoload error

{$e->getMessage()}

HTML; exit(1); } $params = $_SERVER; $params(Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS) = array_replace_recursive( $params(Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS) ?? (), ( DirectoryList::PUB => (DirectoryList::URL_PATH => ''), DirectoryList::MEDIA => (DirectoryList::URL_PATH => 'media'), DirectoryList::STATIC_VIEW => (DirectoryList::URL_PATH => 'static'), DirectoryList::UPLOAD => (DirectoryList::URL_PATH => 'media/upload'), ) ); $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $params); /** @var MagentoFrameworkAppHttp $app */ $app = $bootstrap->createApplication(MagentoFrameworkAppHttp::class); $bootstrap->run($app);

Interestingly, shortly after the use directives, I find an exit () directive.
If I use Apache to serve the site, no problem, but when I switch to nginx, my only way to get this to work is to comment on this exit ().

Why is it there and what is it for?