httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gene LeDuc <>
Subject Re: [users@httpd] .htaccess and PHP
Date Wed, 23 Jul 2008 23:06:51 GMT
Hi Skip,

I'm not an expert, but I've been messing with mod-rewrite a bit 
recently.  My guess is that you need a rewrite condition like this before 
your RewriteRule:
   RewriteCond %{REQUEST_METHOD} ^GET


At 02:48 PM 7/23/2008, Skip Evans wrote:
>Hey all,
>I'm new to the list and am having some issues with a RewriteRule I've 
>applied in an .htaccess file. Or perhaps not the rule, but with using 
>.htaccess in general.
>What I wanted to do was allow users to enter a URL like the following:
>and then have my PHP/MySQL application receive this URL in the index.php 
>file, and then get the wi and madison values from the $_GET array.
>To do this I have the following in the .htaccess file.
>Options +FollowSymlinks
>RewriteEngine on
>RewriteRule ^([^/]+)/([^/]+) /index.php?st=$1&sc=$2 [NC]
>And this is successful in accomplishing the goal.
>In the index.php file I can use
>$_GET['st'] to get 'wi', and $_GET['sc'] to get madison, if someone enters 
>the URL
>into their browser. The problem I have now, though, and that really 
>surprises me, is that if this .htaccess file is in place, the application 
>no longer picks up its style.css (cascading style sheet), or the 
>JavaScript AJAX files, which are included in a header.html file that 
>index.php reads in.
>How exactly the style sheet and JS files are read in is not anything 
>unusual, just the regular syntax in the <head> section of an html file.
>But the main point is that when the .htaccess file is in place, they are 
>not accessed, and when it is not they are.
>Can anyone direct me where to begin researching this kind of issue? I'm at 
>a bit of a loss where to begin.
>Skip Evans
>Big Sky Penguin, LLC
>503 S Baldwin St, #1
>Madison, WI 53703
>Check out PHPenguin, a lightweight and versatile
>PHP/MySQL, AJAX & DHTML development framework.
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:

Gene LeDuc, GSEC
Security Analyst
San Diego State University 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message