php - CodeIgniter Route works over CIFS mount but not with local files -
our dev environment @ work uses single centos machine apache/php serves different virtual hosts both cifs mounted , local directories. our application built using codeigniter 2.0
we made change our routes working fine virtual hosts serving mounted drives, routes cannot resolved local files, resulting in 404.
$config['base_url'] = "http://production.host.com"; // production value of $_server['server_name'] routes:
$route['companyone'] = 'sso/platformsso/requestgenericsso/companyone'; $route['companyone/(:any)'] = 'sso/ptlatformsso/requestgenericsso/companyone/$1'; this works following scenario:
<virtualhost 192.168.1.1:80> serveradmin me@host.com documentroot "/var/mnt/a" servername "a.tmbc.com" errorlog logs/a.error.log alias ssaml /var/simplesamlphp/www </virtualhost> <directory "/var/mnt/a"> options followsymlinks allowoverride order allow,deny allow </directory> directory populated using cifs mount: mount -t cifs //1.2.3.4/a /var/mnt/a -o rw,username=un,password=pwd,uid=48 --verbose1 but not work scenario:
<virtualhost 192.168.1.1:80> serveradmin me@host.com documentroot "/var/www/html/b" servername "b.host.com" errorlog logs/b.error.log alias ssaml /var/simplesamlphp/www </virtualhost> <directory "/var/www/html/b"> options followsymlinks allowoverride order allow,deny allow </directory> directory populated using svn checkout: svn checkout file:///var/svn/repo/trunk /var/www/html/b .htaccess:
addtype text/x-component .htc <ifmodule mod_rewrite.c> rewriteengine on rewritebase / # restrict unused http methods rewritecond %{request_method} !^(get|post|head) rewriterule .* - [r=405,l] # forces ssl rewritecond %{https} !=on rewriterule ^.*$ https://%{http_host}%{request_uri} [l,r=301] #removes access system folder users. rewritecond %{request_uri} ^_sys.* rewriterule ^(.*)$ /index.php/$1 [l] rewritecond %{request_uri} ^_app.* rewriterule ^(.*)$ /index.php/$1 [l] rewriterule ^(.*).(pdf|exe|doc|mp4)$ /externaldownload/?filelocation=$1.$2 [r,l] #checks see if user attempting access valid file, #such image or css document, if isn't true sends #request index.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l] </ifmodule> any ideas of why so?
i think understand issue here. problem seems on (:any) route rule.
$route['companyone/(:any)'] = 'sso/ptlatformsso/requestgenericsso/companyone/$1'; a url companyone first segment of url , second segment remapped sso/ptlatformsso/requestgenericsso/companyone/$1
it seems codeigniter passing $1 variable function companyone means matching route there forced rewrite.
how condensing route rules , make a
$route['(.*)'] = "sso/ptlatformsso/requestgenericsso/companyone/$1"; or have 1 rule there routes such as
$route['companyone/(:any)'] = 'sso/ptlatformsso/requestgenericsso/companyone/$1';
Comments
Post a Comment