apache

URL redirection added to .htaccess

Can anyone help me with adding the redirect rules to my .htaccess? I want to redirect websites visitors based on the URL they enter. For example: If a visitor enters URL without www to be redirected to my root (index.php) If a visitor enters URL, but with the WWW to be redirected to http://domain.com/home/index.html Edit: From your...

Pylons deployment questions

I'm a beginner with Pylons and I've mostly developed on my localhost using the built-in web server. I think it's time to start deployment for my personal blog, I have a Debian Lenny server with apache2-mpm-prefork module and mod_wsgi - I've never really used mod_wsgi or fastcgi and I hear either of these are the way to go. My questions:...

How to config Apache & php run as superuser

i try to config apache & php for my project to create web-based for file config management to open vpn in bsd unix, but i can't run as superuser to start or stop service ...

.htaccess or httpd.conf

I need to do a url-rewriting job now. I don't know whether I should put the code into a .htaccess or httpd.conf? EDIT What's the effecting range of .htaccess?Will it affect all requests or only requests to the specific directory it's located? ...

PHP variables in mysql queries

Hi. Im using mysql with PHP, I was just wondering if this query, $query = "UPDATE tblName SET field='$fieldValue' WHERE field2='$fieldValue2'" would cause an Out of Memory Error in mysql. Will this query, $query = "UPDATE tblName SET field='".$fieldValue."' WHERE field2='".$fieldValue2."'" consume less memory than the previous one? Im ...

rails passenger doesn't boot correctly

i'm trying to get working an old rails 2.1 application configured with mongrel cluster. passenger is correctly installed on my system (apache) with this configuration LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5 PassengerRu...

custom 404 page for nonexistent php files

Hi, I just tried to redirect nonexistent files on the server to my custom 404 page but it only redirects .html files. I used that in my .htaccess file: ErrorDocument 404 /404/404.html How can I redirect all nonexistent files (including .php) to my custom page? Thanks ...

Disabling serving PHP files from a folder in .htaccess

I have a directory on server, from which I only want .JPG files to be served by apache - and apache should deny requests for php, php3, php5 etc files. What should I write in .htaccess? I have tried following, first two are giving 500 internal error, third one is not working at all! <Directory full-path-to/USERS> <FilesMatch "\.(php...

"Can't call method "dir_path" on an undefined value" when running Mason component on the command line

Greetings, I'm trying to develop some tests for Mason components which requires running them on the command line instead of the web server. When I try this, I get an error: perl -MHTML::Mason::Request -MHTML::Mason::Interp -I./lib \ -e '$int = HTML::Mason::Interp->new( data_dir => "/home/friedo/cache", comp_root => "/home/friedo/comps"...

Impossible to mod_rewrite based on existence of file in mod_aliased directory?

I'm trying to do something like the following in my .htaccess file: Alias /assets /location/of/files RewriteCond %{REQUEST_URI} ^/assets/[0-9]+.jpg$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* /build_thumbnail.cfm?path=%{REQUEST_URI} [QSA,L] So in theory it's quite straightforward: an image is requested from a url starting w...

mod_rewrite: Rewriting / to cgi script

Is there any way to rewrite a GET / to a cgi script with a parameter? Basically redirect / to /cgi-bin/scipt.cgi?123. This does not work: RewriteEngine On RewriteRule ^/$ /cgi-bin/script.cgi?123 [L] Instead it somehow rewrites / to /index.html/ Any way of doing this? ...

Is %20 in site urls and and file name can create any problem on any server or browser(web/mobile) or OS or device etc ?

Is %20 in site urls and and file name can create any problem on any server or browser or device etc ? Is it bad for SEO ? ...

Can't access property generated by a script in an imported ANT target.

What I'm trying to do is compile to a file which takes it's version from a constant inside my source files. I have a setup like this (or at least the significant bits): tasks/compile.xml <project name="Compile"> <target name="check.version"> <script language="javascript"> regex = /VERSION.+?"([\d\.]+)";/; ...

Apache problem on Mac

I couldn't visit 127.0.0.1 on my mac . I turned on the "web share" already. and there is no "httpd" process in Activity Monitor ...

URL Rewriting In PHP MVC Framework

Hello there, I have made my own custom php framework which implements MVC design pattern. In it, all URLs are constructed like this mysite.com/index.php?route=controller/function/parameters/go/here mysite.com/index.php?route=products/shirts/99 etc I have put in place htaccess to remove index.php?route= part from URLs to make them m...

How to check where Apache is looking for a php.ini file?

I have a feeling that Apache is using a different php.ini file that the one I am editing. I make a change in my php.ini file, restart Apache, and the change doesn't take affect. So I don't know what to do anymore. Any ideas? Update: Found out it's using the right php.ini file...but I still don't know what to do! ...

Are these two re-writes the same?

How are the following different? Ignore the domain names. RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/$1 [L,R=301] The difference is "^"? What I basically want to do is have my site as ...

Are there any webforum projects for ASP and IIS like there is for PHP and Apache?

I wonder if anything similar exists. If it does, I can't find it. Most webforums are written completely in PHP and are designed to run on Apache these days. Don't start any software argument here please. ...

Apache authentication: Redirect on failure, reliably?

I've set my ErrorDocument 401 to point to my website's account creation page, but not all browsers seem to honor this redirect (Safari). Also, other browsers (Firefox, Chrome) never quit asking for the password and show the ErrorDocument. This causes a good number of users to give up trying after many password attempts without seeing th...

mod re-write OS X 10.6

I have OS X 10.6 and am working on a website. When I look at the http.conf file in /private/etc/apache2/httpd.conf it appears that the mod-rewrite module is loaded yet when I add a simple .htaccess file to the root of my site, it doesn't seem to do anything: Options +FollowSymLinks RewriteEngine on RewriteCond $1 !^(index.php|index.htm...