apache

PHP Force Apache error

Hi dear stackers :P Thanks to this forum, I learnt PHP header function does not actually send header to Apache server but only to the client. What I wanna do is to generate an error 500, and let Apache displays its corresponding page. Is there a way to force it ? Thanks in advance ! (and allez les bleus !) ...

trouble with ruby passenger

when i paste this code in MAMP's httpd.conf: LoadModule passenger_module /Volumes/Private/ajsie/.rvm/gems/ruby-1.9.1-p378/gems/passenger-2.2.14/ext/apache2/mod_passenger.so PassengerRoot /Volumes/Private/ajsie/.rvm/gems/ruby-1.9.1-p378/gems/passenger-2.2.14 PassengerRuby /Volumes/Private/ajsie/.rvm/rubies/ruby-1.9.1-p378/bin/ruby then...

How to hide URL from users when submitting this form?

I have a form with many many fields... When submitting these fields, I use the POST method which hides the actual variables passed along to the PHP page. However, I can't get rid of the complete link. Changing from GET to POST did make all the form fields invisible in the URL, but this part is still visible: mydomain.com/bin/query# ...

Joomla Mootools file getting truncated

Hi, I am trying to run Joomla on my local machine. I have installed wamp 2.0 and everything installed ok with it and I managed to see it running. I have now come to install Joomla 1.5.18 but I am having a problem with the mootools file on the installation wizard. When running through the installation process in FireFox with firebug tur...

Rewrite Trailing Slash Issue

Here is my .htaccess file Options +FollowSymlinks RewriteEngine on ErrorDocument 404 /404.php RewriteRule ^(\d*)/(.*) /page.php?id=$1&slug=$2 It all works fine. But the moment I type site.com/342/my-page/ (with the trailing slash) I get a 404. I need the trailing slash as optional. I.e it will redirect to the correct page with or wi...

Can tomcat perform ssl redirection by filtering host alias?

Hi, We have a tomcat server (6.0.20) running one web application behind two urls, e.g. www.foo and secure.foo This is configured in the server.xml as one host with a single alias: <Host name="www.foo" appBase="webapps"> <Context docBase="foo" path=""></Context> <Alias>secure.foo</Alias> </Host> Ideally we'd like any requests...

A short "RewriteRule" regexp question

I have a very very long querystring which ALWAYS starts like this: mydomain.com/bincgi/sql_query.php?alot alot alot of variables passed along What is the regular expression to make a rewriteRule if I want to pass along all the variables but via this link: mydomain.com/search/all variables here instead..... So the last one is wh...

IIS, Apache, and header()

I'm working on migrating a website from an external server (running Apache) to a local server (running IIS), and have come across an issue that I can't seem to resolve. The site is using a custom Joomla plugin that grabs some graphics stored in a mysql database (for e.g. http://www.norfolktourism.ca/index.php?option=com_bdirectory&amp;t...

mod_python can't see my Django project settings file

Hey, I need to deploy my Django application on my apache server, I've added the following to my httpd.conf: <Location "/dashboard/"> SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['/home/firas/project/trunk/dashboard/analytics','/home/firas/project/trunk/dashboard', '/home/firas/project/...

Php referrer works or not?

I need to know the referring server for a page on my site. Is there any safe method to check where the user "came" to the page FROM? I tried uploading this to my server, but this wont output anything at all when I write the adress to the file in the browsers adress bar: <?php echo $_SERVER['HTTP_REFERER']; ?> I need to check thi...

Compare http_referer value

My http_referer says this: http://www.domain.com/search/?etcetcetcetc... I need to compare my http_referer to look for this: http://www.domain.com/search And if the first part of the referer is this, then do some code... Ex: if($_SERVER['HTTP_REFERER']=='http://www.domain.com/search'){ do stuff... But first ...

Any way for a server-side include to get the file name or URL of the file where it is being included?

Is there any way for a server-side include to determine what file it is being included in? I would like to do something like this: <ul id="menu"> <!--#if expr="$URL = index.html" --> <li><span>Home</span></li> <!--#else --> <li><a href="index.html">Home</a></li> <!--#endif --> <!--#if expr="$URL = about.h...

Redirect Using htaccess

I am trying to redirect /folder to / using .htaccess but all am I getting is the Apache HTTP Server Test Page. My root directory looks like this: / .htaccess -/folder -/folder2 -/folder3 My .htaccess looks like this: RewriteEngine On RewriteCond %{REQUEST_URI} !^/folder/ RewriteRule ^(.*)$ folder/$1 [L] What am I doing wrong? I che...

Removing special chars from URL with .htaccess

Hi all, I'm trying to use urls on my site like example.com/@lorem-ipsum-dolor instead of example.com/tag/lorem-ipsum-dolor form. It's working on my local and remote servers, but if urls contains " : \ * | etc chars it's not working on local server (Win XP). Is there any solution? If not, then I think I need to remove that chars from ...

RewriteCond to change displayed host, but not server

Typing out the title to this leads me to believe this might not be possible due to security concerns, but I will ask anyway. I have shortcode support running on my server, lets call it xx.yy I want it so when a user sends a request to xx.yy, it just changes the displayed host to another valid domain running on the same box. I have thi...

Apache modules installed but don't seem to load in Ubuntu

I am pretty new to Linux. Got a VPS set up yesterday, installed Apache2, PHP5 and MySQL. When I do apache2 -l I get this: Compiled in modules: core.c mod_log_config.c mod_logio.c prefork.c http_core.c mod_so.c When I do sudo a2enmod rewrite I get this: Module rewrite already enabled And rewrite.load is in /etc/apache...

php most memory efficient way to return files

so i have a bunch of files, some can be up to 30-40mb and i want to use php to handle security of the files, so i can control who has access to them that means i have a script sort of like this rough example $has_permission = check_database_for_permission($user, filename); if ($has_permission) { header('Content-Type: image/jpeg'); ...

How to Set up Virtual Static Subdomain

Given current rewrite rules at http://www.example.com/: Options +FollowSymlinks +Includes RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/?(.*) http://www.example.com/$1 [L,R,NE] # Remove all "index.html"s. RewriteCo...

.htaccess rewrite rule to add a string in the middle of the URL

Using a .htaccess rewrite rule, I need to add "?q=" before the path on any URL's containing the word "imagecache" Therefore, if the URL is: http://mysite.com/sites/default/files/imagecache/myimage.jpg ...then it will really try: http://mysite.com/?q=sites/default/files/imagecache/myimage.jpg But that will ONLY happen if the URL c...

Make Apache Web Server load new images and CSS

How to make apache web server dynamically load new CSS and images? The purpose is to change the look and feel of portals in a cluster of load balanced web server instances, dynamically. I get a list of files that are changed and would be pushing to web server instances. Now the web server should, display the new CSS and images instead of...