Welcome Guest, Not a member yet? Register   Sign In
htacess rule to exclude controller folder from a existing rule
#1

(This post was last modified: 03-13-2018, 02:16 AM by gse268599.)

Hi guys

I have htaccess rule to redirect my full website to https, i would like to exclude controllers/api folder from this redirection and keep it with http instead https

1. here is the link calling folder controllers/api folder
http://apphotel.ch/app_fe_dev/api/profile?client=31&language=1

2. here below is my current htacess content

# File modified on Wed Sep 23 23:12:19 2015 by server
# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives
# php_value memory_limit "512M" 
# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives
# php_value upload_max_filesize "100M" 
# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives
# php_value post_max_size "100M" 

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/api
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]]

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} ^/(?!source)
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
 
<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin
   ErrorDocument 404 /index.php
</IfModule>


3. my folder structure
app_fe_dev
-application
-- controllers
---- api (this folder to be exclued from https redirection we want to keep it http)
------ profile.php
------ welcome.php
------ register.php

thank you very much for your help

cheers 
Antony

Attached Files Thumbnail(s)
   
Reply




Theme © iAndrew 2016 - Forum software by © MyBB