.htaccess rewrite problem on IBM i 7.1

General discussion on Zend Server for IBM System i

.htaccess rewrite problem on IBM i 7.1

Postby michael-linden on Tue Aug 15, 2017 2:15 pm


we are using a rewrite-rule for our zf2 project with a .htaccess file:

Code: Select all
RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ %2public [QSA,L]

This is working fine with zendsever 8.5.7 on IBM i 7.2 and IBM i7.3 systems. On IBM i 7.1 this rule is not working, we have tested it on more than on partition/installation. A system update is not possible for this machines.
Can somebody reproduce this error on IBM i 7.1 or has some ideas?

Kind Regards
Posts: 6
Joined: Thu Sep 16, 2010 2:36 pm

Re: .htaccess rewrite problem on IBM i 7.1

Postby stewartm on Fri Oct 06, 2017 11:55 am


I don't know much about htaccess but I can tell you the following works for me on IBM V7R1 in ZS9.1

Code: Select all
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
RewriteBase   /
Posts: 18
Joined: Thu May 17, 2012 3:14 pm
Location: Coleraine, N.Ireland

Return to Zend Server for IBM i

Who is online

Users browsing this forum: No registered users and 2 guests