apache

Can't Add Slash with .htaccess

I have a site with some html files on it. One of them is contact.html. This is my .htaccess, and I'm having problems where I can address the page with site.com/contact, but not site.com/contact/. (Note ending slash.) What's the fix? RewriteEngine On # If the requested URI does not contain a period in the final path-part RewriteCond %{R...

If you use https will your url params will be safe from sniffing?

Suppose I setup a simple php web server with a page that can be accessed by https. The url has simple parameters like https://www.example.com/test?abc=123. Is it true that the parameter here in this case will be safe from people sniffing the packets? And would this be true if the server does not employ any SSL certificate? ...

mod_rewrite issue

Hey all, I have the following rule: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] and my url is as follows: http://www.mydomain.com/189-9544737-0616922?%5Fencoding=UTF8&node=10 On myphp.php var_dump($_GET): array(3)...

Apache is not sending 304 response (if mod_deflate and AddOutputFilterByType is enabled)

I have added the following line in my Apache httpd.conf: - AddOutputFilterByType DEFLATE text/html text/css application/javascript application/x-javascript application/json I have a html file (test.html) with a script inclusion: - <script type="text/javascript" src="/test.js"></script> The problem is, every time I load test.html, t...

how to use mod rewrite

I have transferred my website from old server to shared server. All my code is in "lfdata/main/com" under "public_html" on the shared server. The clean URL would look like follows: http://ip-address/~name/how and the rewritten URL should be: http://ip-address/~name/lfdata/main/com/how.php So can anyone suggest a rewrite rule for cr...

Redirecting Apache by Geo/Country IP

Do any of you folks do redirection by IP (within Apache) for people coming to your website from different countries? What do ye use? mod_geoip and/or a whole pile of mod_rewrite rules? Is mod_geoip reliable/well-performing/accurate? ...

PHP include() affected by mod_rewrite

Hi, I have inherited a number of grossly coded PHP files, whose output I need to alter programmatically. To achieve this, I chose to run them through another PHP file, rewriter.php, which looks approximately like this: <?php if(!preg_match('/^([a-zA-Z0-9\-_]*)$/', $_GET['page'])) die('Incorrect page supplied.'); ob_start('changeOutp...

Apache + Vista = No Ports? (Why thanks, Skype)

I've gotten a new machine, but it came with Vista. I figured it would be best to wait for W7 before I spent any money on an OS, so I'm stuck with it for now. But I must get my development environment setup, and soon! My machine came with McAfee, which I'm using for the moment, and I've let port 80 be open and I've given httpd.exe acce...

How to secure an admin area for a public and private rails app

How would you secure access to the admin area for a web app? Our Rails CMS serves pages publicly. I would like to make the backend (/admin) inaccessible using either the webserver(apache) or firewall(netfilter). Could this be done using an SSL certificate? I would like to limit access to the backend to only those whose have the "key"...

set charset in rails application

I'm trying to setup my charset in a html view in a RoR application. I configured already the charset by meta equiv tag: **meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" ** It didn't work, so i tried to change my .htaccess (its a RoR application running under apache) but here is my problem. Normally i could use th...

What is the Java equivalent to webmin?

webmin is a administration/UI framework for configuring software. I am curious if anyone know what the Java equivalent might be? ...

Rails page caching with Apache and capistrano

The following post explains about the page caching in rails with Nginx. http://blog.hasmanythrough.com/2008/1/30/segregated-page-cache-storage I like to implement this solution with my app but on Apache. So, the main block/route is if (-f $request_filename) { break; } if (-f /cache$request_filename) { rewrite (.*...

Why does running "apachectl -k start" not work, but "sudo apachectl -k start" does?

I'm working on my OS X with the default installation of Apache. For some reason, when I run the "apachectl" command without the "sudo" I get "no listening sockets available / unable to open logs." I'm guessing this is a permissioning thing, so can someone help me out? I'm using Apache 2.2. Also, side question, where the the Apache sc...

How do I rewrite URLs that have GET variables in them?

I have a site that makes use of GET variables to determine what to display. @session_start(); @extract($_GET); @extract($_POST); . . . if (!$menu) { include("home.php"); } if ($menu=='buy') { include("buy.php"); } if ($menu=='invalidbuy') { include("invalidbuy.php"); } if ($menu=='buydone') { include("buydone.php"); } . . . I think I ...

What does "apachectl" stand for? Why isn't it just "apache"?

This should be easy, just curious. I know "httpd" is the HTTP daemon, just curious what the relationship is between "httpd" and "apachectl." ...

Removing index.php from website URLs

I am using the Kohana framework (but I think it's irrelevant for this question) and pages can be accessed like so http://www.example.com/articles/ http://www.example.com/index.php/articles/ Now, as a rule of thumb, I generally try and tweak my .htaccess to only allow one way in for a page, and silently redirect other common ways. Ess...

.htaccess Edge Case

I am using these rules and conditions in .htaccess to turn these http://www.example.com/index.php/about/history http://www.example.com/about/history/index.php into http://www.example.com/about/history .htaccess # ensure there is no /index.php in the address bar RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ R...

Why does this config code not work in .htaccess?

<VirtualHost *:80> DocumentRoot /lf/main/com ServerName 74.220.215.241/~laborfa2 ServerAlias 74.220.215.241/~laborfa2 RewriteEngine on #RewriteLogLevel 2 #RewriteLog logs/rewrite.log RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.php -f RewriteRule ^/(.*)(/?)$ /$1.php [L] RewriteRule ^/([a-zA-Z]+)([a-...

Is there any API for getting start time of a APACHE WebServer?

I am writing a small application to get the various diagnostic parameter of Apache Webserver like time of the start of the server, Worker mode or Prefork mode, server version and many more. I have found few API for getting info about these parameter. But I colud not find nay API for the getting start time of the WebServer. Is there any s...

Help with mod_rewrite rule for dynamic url

Ugh.. mod_rewrite makes me feel stupid. I just haven't wrapped my brain around it yet. :/ I have this url: http://example.com/a/name/ ...that I want to point here: http://example.com/a/index.php?id=name ...where name is what is getting passed to index.php as the id argument. Anything I've tried results in either a 404 or a 500.. :(...