473,508 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

apache_get_modules() solution

79 New Member
Hello,

I am using mod_rewrite in one of my scripts, and needed to detect if the mod_rewrite module is loaded.

I was using apache_get_modules() before but after switching to a new host, i noticed that its disabled on the server and they won't enable it either.

But i 100% that mod_rewrite is enabled, but no way to know via my script since it used to rely on that function.

I was wondering if someone knows of any other ways to detect if mod_rewrite is enabled?

I would really appreciate any help :)

Regards,
Mar 13 '10 #1
3 3239
Atli
5,058 Recognized Expert Expert
Hey.

You could always just create a unique rewrite rule that - if mod_rewrite is enabled - would redirect you to somewhere (an empty text file, for example). Then you would just use get_headers() on the URL and see if it returns 200 or 404 as the HTTP response (fist element of the return array).
Mar 14 '10 #2
zubair1
79 New Member
Thanks for the reply, that's an awesome idea at least for second choice.

is it possible for you to provide me with some code to get me started?

Regards,
Mar 14 '10 #3
Markus
6,050 Recognized Expert Expert
Create your rewrite-rule. Something like:

Expand|Select|Wrap|Line Numbers
  1. RewriteRule ^/path/to/rewrite$ /rewrite/to 
  2.  
Then in your PHP script that needs to know whether the rewrite engine is working, call get_headers() on that URL:

Expand|Select|Wrap|Line Numbers
  1. $headers = get_headers("http://yoursite/path/to/rewrite");
  2.  
  3. if ($headers[0] == '404') 
  4.     $rewrite_engine_enabled = false;
  5.  
Something like that.
Mar 14 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2367
by: Wayne Wengert | last post by:
I have a solution. I want to clone it to try some different options. Is there a way to open Solution A, save it as Solution B and then be able to try some things in Solution B without affecting...
10
510
by: Simon Jefferies | last post by:
Hello, I'm getting a strange problem where when I load up my solution that has three projects:- a managed C++ .NET, one C++ lib, and a VB library. It locks up and doesn't load completely, I...
0
1628
by: TEK | last post by:
Hello We have a quite huge project. To limit the solution size, rebuild time and so on we have divided the project in two different solution. One solution that holds the buiness entities, or...
6
18555
by: I_AM_DON_AND_YOU? | last post by:
I have a small VB.Net Solution. The solution has filename LABELMAKER.SLN and the the project has filename LABELMAKER.VBPROJ. There is another file LABELMAKER.VBPROJ.USER. All these are in a...
5
2203
by: kai | last post by:
Hi, I use XP Pro and VS2005. I find when I create a new Website, I only see the Project node not Solution. After I add sedcond project under the solution tree, then I see the solution node. How...
2
1761
by: mkd1919 | last post by:
I'm developing a web service that will eventually be sent to other like organizations to communicate for a particular application. After a few weeks, I decided it would be better to split of the...
2
2133
by: cashdeskmac | last post by:
Why is it that when I create a new web application, the project folder containing the webform, web.config and csproj files appears in C:\inetpub\wwwroot, yet my .sln and .suo files appear in...
3
2144
by: Manikandan | last post by:
Hi, I'm copying projects from a solution in the vss. In my local system i created solution ,added that project(make modification related to solution) When i added this solution to vss, projects...
0
2330
by: techie | last post by:
List of Solution manuals: Engineering Circuit Analysis 6Ed - Hayt Solutions Manual Norbury - Solutions manual for mechanics and thermodynamics Physics For Scientists And Engineers - Solution...
16
3973
by: =?Utf-8?B?RHdlZWJlcmVsbGE=?= | last post by:
I created an Access 2007 application for my customer. The application is shared by three employees on a server. It maintains a contact list including financial data and social security numbers. ...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.