.htaccess

How to set site in maintenance mode trough shell-script?

For my next project I will use automatic deployments with git. I can run a shellscript before and after deployment. Is it possible to set "maintenance" automatically with shell? In my .htaccess then I would check if a server variable is set to deployment or not to do the rewrite to maintenance? Is this possible and how should I handle ...

Force WWW in .htaccess without having the domainname

Hi, I'm searching for some rewriterules to do this: Force a user to use WWW if he hasn't given an subdomain (so other subdomains should be working) If it's a HTTP or HTTPS connection, the script is still working If the url is 'example.nl', 'example.de', 'whatanexample.com' or something other, the same script is working in all this cas...

Simple URL Mod_rewrite

Why does the following htaccess file generate 300 errors, when this URL is called? URL: hxxp://subdomain.domainame.com/keyworda/ IndexIgnore * RewriteEngine on RewriteRule ^([a-z]+)/$ /index.php?p=$1 Error log: 300 hxxp://subdomain.domainame.com/keyworda (no trailing slash) ...

Gzip compressed website not working with IE

In my site I have some gzipped copies of the most used and largest files (because my hosting doesn't allow using the gzip compression module). I have inserted rewrite rules in the htaccess file to send the gzipped copies when available, like this: <FilesMatch "\.html\.gz$"> ForceType text/html Header set Content-Encoding: gzip </Fi...

Reason ForceType application/x-httpd-php on .htaccess not working at all

I have tried to use: .htaccess <Files client> ForceType application/x-httpd-php </Files> client file <?php echo "FOO BAR"; ?> Just to test, but the server is not parsing the client file, it just serves it up as a file download. I tried SetHandler also without luck. UPDATE I'm using MediaTemple and the have there own way o...

How to make search engines index search results on my website?

I have a classifieds website. It has an index.html, which consists of a form. This form is the one users use to search for classifieds. The results of the search are displayed in an iframe in index.html, so the page wont reload or anything. However, the action of the form is a php-page, which does the work of fetching the classifieds et...

Login with HTTPS to htaccess protected directory

Hi! the app i am currently building needs to perform a login with username and password. I am using the DefaultHttpClient to execute the request and setting the username and password as credentials. the server expects a htacces-login. The Result i get is not the Logintoken i hoped for. Instead it returns an Errormessage. Can anybody tell...

HTACCESS issue- domain vs subdomain.

I have got lots of ideas from google and stackoverflow- but none of those was exactly what i am looking for. here is scenario- I have bought a hosting space from a provider. I had to provide a domain name(let abc.com) as the primary domain of that hosting space. Then i have found that i have to put all the contents for that rimary doma...

Rewriting URLs in htaccess

I am trying to rewrite some url's. All the Urls look something like this www.domain.com/index/c/index/ www.domain.com/index/c/about/ www.domain.com/index/c/store/ I would like these urls to look like the following: www.domain.com www.domain.com/about www.domain.com/store I have tried several different things in the htaccess file but ...

Append Query String via Apache Rewrite Rule

How can I rewrite the following: http://www.mydomain.com/my-page.html to http://www.mydomain.com/my-page.html?type=1 Tried the following without any luck: RewriteRule /car-covers.html$ /car-covers.html?type=$1 [R=301,L] RewriteRule ^car-covers.html$ car-covers.html?type=$1 [QSA,L] ...

.htaccess how to substitute urls

How can I substitute URLs of a web application in a sub folder as installed on root. e.g. need to map example.com/index.php to example.com/new/index.php I do not want redirection but url rewrite to exempt folder name. Help me to learn and define rules. ...

Doesn't recognized my css, js, and so on...

I have .htacces like: RewriteEngine On RewriteRule ^en/$ index.php?page=index&lang_id=2 RewriteRule ^contact.html$ index.php?page=contact RewriteRule ^en/contact.html$ index.php?page=contact&lang_id=2 # ...[and so on] In my site i have a switch language button(image). My basic language is in Ro and and i want to swtich ...

ExpiresActive On .htaccess explanation

[i]ExpiresActive On ExpiresByType image/gif A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/png A2592000 BrowserMatch "MSIE" brokenvary=1 BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 BrowserMatch "Opera" !brokenvary SetEnvIf brokenvary 1 force-no-vary[/i] saw this code in a sample .htaccess recently. Presumably Expire...

.htaccess questions giving multiple parameters

i want to do /par/par/par now i do it with the following function but i would like to know if this is possible in .htaccess function exploder($data) { $parameters = explode('/',$data['id']); return $parameters; } and the amount of parameters should be variable the result are something like this url/par1/par2/par3 this coul...

How do I stop my .htaccess file causing a recursive redirect

Using the following .htaccess to redirect my query to fcgi scriptI get a recursive redirect problem. Can anyone suggest what needs tweaking? AddHandler fcgid-script .fcgi RewriteEngine On RewriteCond %{HTTP_HOST} !^answers.mynewdomain.co.uk$ [NC] RewriteRule ^(.*)$ http://answers.mynewdomain.co.uk/$1 [R=301,L] RewriteCond %{REQUEST_F...

.htaccess rewriteRule help

I have a link in my index.html: href="my_page.php?cat=14&p=1"; Now, how can I rewrite this so that it looks like this: /my_page/14/1 I have this so far, but I don't know how to add the ending '/1' to this: RewriteRule ^kategori/([0-9_]+)$ browse_cat.php?cat_gr=$1 [NC] Thanks ...

Problem after migrating Magento

I am trying to create an exact mirror of a Magento production server on my local server for further development, but I have run into a few issues. On the production server, our Magento is configured to run without displaying the index.php, but after attempting a migration to my local server, the index.php is required to access any links...

make example.com/user/Bob go to profile.php?user=Bob

My current http access file is # Pound sign comments a line out # Disallow viewing of htaccess files <Files .htaccess> order allow,deny deny from all </Files> Options +FollowSymLinks RewriteEngine On # enable hiding php extension RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php ...

better way to debug XAMPP authentication issue

Hi all: I've been working with a simple authentication process on localhost, here is the .htaccess file: AuthType Basic AuthName "Admin login page" AuthUserFile /Application/XAMPP/htdocs/.htpasswd AuthGroupFile /dev/null Require User [email protected] I have created the related .htpasswd file, the browser can prompt for me to...

Running a django project in a subdirectory of a site already running Drupal

Hi guys, This problem has been bugging me for the last week or so and now I am coming up on a deadline. I have a site on a Media Temple DV server that is running Drupal in the webroot (servername.org). I am adding a django site and I would like it to be located at the url servername.org/myproject. I have build the project (in a directory...