LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > How to detect with PHP if Rewrite is enabled?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-26-2010, 05:29 AM
vassilevsky vassilevsky is offline
New Member
 
Join Date: Oct 2010
Location: Ulyanovsk, Russia
Posts: 1
Question How to detect with PHP if Rewrite is enabled?

Hello

When PHP is working as an Apache module, the apache_get_modules function is available and it lets you determine if mod_rewrite is loaded.

Is there a similar function for LiteSpeed Web Server?

How one should check if URL rewriting is enabled?

Reading a rewritable URL from own server with cURL seems too heavy.
Reply With Quote
  #2  
Old 10-26-2010, 05:09 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
PHP doesn't yet have such a function for LSWS.

LSWS URL rewrite engine can enabled at virtual host and context level, and is inherited along the directory tree until it is explicitly overridden.

You can just create a unique rewrite rule that, if rewrite engine is enabled, would redirect to somewhere (an empty text file is suffice). Then test it with 'curl -I URL' (doesn't have to on the same box) and see if it returns 200 or 404 as the HTTP response.
Reply With Quote
Reply

Tags
php, rewrite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:35 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.