Welcome Guest, Not a member yet? Register   Sign In
Shorted URL don't work
#1

Good morning
I use CodeIgniter 4 for a work proyect. In my computer works correctly, but in the server the shorted urls don't work. I and the server admind tray but we don't find any solution. In the same server have a CI 3 proyect for 1 year and works correctly.

This is the Apache config:

Code:
<VirtualHost *:80>
  ServerAdmin [email protected]
  ServerName  www.miweb.es
  ServerAlias miweb.es
  DocumentRoot /miweb/public
  ErrorLog ${APACHE_LOG_DIR}/miweb_error.log
  CustomLog ${APACHE_LOG_DIR}/miweb_access.log combined
  <Directory "/miweb/public">
    Options +Indexes +FollowSymLinks +ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>

And app/Config/App:
Code:
public $baseURL = 'http://miweb.es/';
public $indexPage = '';
public $uriProtocol = 'REQUEST_URI';
Reply
#2

(This post was last modified: 08-17-2020, 09:23 AM by InsiteFX.)

In your ,htaccess file where index.php is add this:

Code:
# apache .htaccess file remove www
<IfModule mod_rewrite.c>
    
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule (.*) https://example.com/$1 [R=301,L]
    
</IfModule>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB