473,669 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

apache_get_modu les() 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_modu les() 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 3248
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
2380
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 Solution A? -- ------------------------------------ Wayne Wengert wayne@wengert.org
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 have to do the following to work around it.
0
1637
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 mapping and stuff like that. One solution that holds the application, windows controls and stuff like that.
6
18562
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 directory called LABELMAKER. Everything is working fine. I just wanted to rename the directory and filenames. So I changed the directory name as "EASYLABEL" and also changed the filenames as EASYLABEL.SLN, EASYLABEL.VBPROJ and EASYLABEL.USER. So...
5
2213
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 do I setup VS2005 to see the solution node after I create the first project without adding the second project in the same solution? Thanks
2
1766
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 web service and custome code from the required code. In doing so, I created a class project. This left me with a new solution of a web site and a class. I had previously created the class seperately and added it to sourcesafe. I then added...
2
2138
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 another folder in My Documents\Visual Studio Projects? Is this normal, or have I somehow made an inadvertant change somewhere?
3
2155
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 are referred to the original solution not from my new solution I will explain more clearly i have project folder in vss(v4.5) v4.5(folder) project1(project)
0
2338
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 Manual RC Hibbeler statistics 11th edition
16
3988
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. Only the office manager generates reports in Access from this client data. Now they want to share this Access application with employees at a remote office. They expect to have a maximum of 30 employees editing the client list in both the...
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8803
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1787
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.