Hi,
I'm having trouble setting up rewrite rules for a subfolder on a vhost.
My document root for the vhost is:
/usr/local/lsws/DEFAULT2/
This vhost has following rewrite rules working:
Inside there is a folder, let's call it "example" (/usr/local/lsws/DEFAULT2/html/admin123456/example/) for which i have created a static context with following configuration:
And following rewrite rules:
mywebsite.com/example is working ok
Now when i try to access mywebsite.com/example/login.htm i get a 404 and in error log i see it tries to match the rewrite rules for the VHost, it doesn't even log any Rule: Match for the context. All it does is this:
Which does exactly nothing.
Any help with the setup would be much appreciated.
I'm having trouble setting up rewrite rules for a subfolder on a vhost.
My document root for the vhost is:
/usr/local/lsws/DEFAULT2/
This vhost has following rewrite rules working:
Code:
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^/api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
# Images
RewriteRule ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
Code:
URL: /example/
Location: /usr/local/lsws/DEFAULT2/html/admin123456/example/
Accessible: yes
Enable Rewrite: yes
Rewrite Inherit: no
Rewrite Base: /example/
Code:
RewriteRule ^plik,([0-9]*).htm$ index.php?plik=$1
RewriteRule ^plika,([0-9]*),([^.]*).htm$ index.php?plik=$1&action=$2
RewriteRule ^login.htm$ index.php?login=1
Now when i try to access mywebsite.com/example/login.htm i get a 404 and in error log i see it tries to match the rewrite rules for the VHost, it doesn't even log any Rule: Match for the context. All it does is this:
Code:
[REWRITE] Rule: Match '/example/login.htm' with pattern '^.*$', result: 1
[REWRITE] Source URI: '/example/login.htm' => Result URI: '/index.php'
Any help with the setup would be much appreciated.