Redirect Issue in the website

Codeigniter website Redirect Issue in the website, redirect issue with website in a linux ,redirect issue with website url in codeigniter in linux here fix the redirect issue using add command to apache server config file


1. Run command in terminal 

sudo a2enmod rewrite


2.  Go to the apache2 directory and edit the file using command  sudo vi apache2.conf


cd /etc/apache2
sudo vi apache2.conf



add  

<Directory /var/www/html/>

        AllowOverride All
</Directory>



.htaccess in codeigniter 


RewriteEngine on

RewriteCond $1 !^(index\.php|public|\.txt)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?$1

Rewrite rules

sudo a2enmod rewrite




Restart apache server Again

sudo service apache2 restart



No comments:

Post a Comment

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...