View Full Version : Does lsws has multiviews function?
elvis7
09-16-2005, 04:05 PM
Hi, I just started using lsws se V2.0.7. Before i used apache, I had there function called MultiViews, does lsws has this function ? If yes, how can it be added ?
mistwang
09-16-2005, 08:44 PM
No, LSWS does not have explicit multiview support, but you can use simple rewrite rules to implement some simple multiview functions.
elvis7
09-17-2005, 08:22 AM
maybe you can give me please some example? I need some thing like this:
If link is http://mydomain.com/browse it should open http://mydomain.com/browse.php
Thank you.
mistwang
09-17-2005, 11:39 AM
You can try some thing like:
RewriteCond <your_doc_root_path>/$1.php -f
RewriteRule ^/(.*)$ /$1.php
elvis7
09-17-2005, 01:55 PM
didn't work for me :(
I wrote:
RewriteCond /home/www/myweb/$1.php -f
RewriteRule ^/(.*)$ /$1.php
mistwang
09-17-2005, 02:06 PM
Is URL Rewrite enabled? Did you restart the server after configuration changes?
To debug the rewrite rule, you can turn on the rewrite log by setting Log Level to '9', then check lsws/log/error.log
It works for me.
elvis7
09-21-2005, 03:04 PM
Still doesn't work. I got:
Enable Rewrite Yes
Log Level 9
Rewrite Rules:
RewriteCond /home/www/torrent/$1.php -f
RewriteRule ^/(.*)$ /$1
here what log shows:
2005-09-22 00:59:19.286 [INFO] [86.57.0.20:61038-0#torrent] [REWRITE] Rule: Match '/' with pattern '^/(.*)$', result: 2
2005-09-22 00:59:19.312 [INFO] [86.57.0.20:61038-0#torrent] [REWRITE] stat( /home/www/torrent/.php ) failed
I'm new to lsws, but I already like this software. Maybe I'm doing something wrong ?
mistwang
09-21-2005, 03:18 PM
rewrite rule should be:
RewriteCond /home/www/torrent/$1.php -f
RewriteRule ^/(.*)$ /$1.php
You are accessing URL '/', this does not work, you should use directory indexing instead, add "index.php" or whatever index file used to "Directory Indexes". if you access "/index" URL, the above rule will serve it with /home/www/torrent/index.php.
elvis7
09-22-2005, 01:04 AM
Yes, it works now. Tnx for help :?