.htaccess

How to redirect or show a page rather than "Forbidden" when i have directory listings off (htaccess/unix)

Hi, I've set it in htaccess so it won't display the contents of directories, rather it will just show the usual Forbidden page. how can i either: show a certain page or redirect to a certain page rather than just this default "Forbidden" page? thanks ...

Query string stoped working

Hi, I have a Codeigniter site which was working perfectly fine on centOS server. But from yesterday the site is not able to detect the query string and I'm getting 500 server error. The same code is working fine at localhost but at the CentOS server its giving error. I'm using clean URL but for Jquery's Autocomplete I need query stri...

How to make a file extension downloadable?

I'm trying to download http://www.downway1.com/dota/eng/DotA%20Allstars%20v6.67.w3x this file. But it's not able to download. It's opening unknown text. How I can set it up? Maybe I can use htaccess? but how ? ...

Dreamweaver and GZIP files

Hi, I've recently tried to optimize my site for speed and brandwith. Amongst many other techniques, I've used GZIP on my .css and .js files. Using PuTTY I compressed the files on my site and then used: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{HTTP_USER_AGENT} !Konqueror Rewri...

Creating simple URL's (.htaccess - mod_rewrite)

I have this structure for my navigation index.php?v=page I am looking to convert it to: www.domain.com/page/ - using mod_rewrite..any ideas on that? I read through some tuts and examples, but couldnt get it working right. Thanks, Ryan ...

How to make this .htaccess rule case insensitive?

This is a rule in my .htaccess # those CSV files are under the DOCROOT ... so let's hide 'em <FilesMatch "\.CSV$"> Order Allow,Deny Deny from all </FilesMatch> I've noticed however that if there is a file with a lowercase or mixed case extension of CSV, it will be ignored by the rule and displayed. How do I make this case insensiti...

SEO - Problems possibly related to 301 Moved Permanently

Right, here's the story: We have had a website for one of our brands now for many years, the site design was very bad and recently did a complete overhaul, mostly design, but also some of the backend code. The original site was using links such as this example.com/products/item/127 and thus I wanted to change them to be move user frien...

How would I redirect two domains using .htaccess

I'm trying to redirect one domain to the root and another to a directory. The problem I'm having is the second domain is overwriting the firsts redirection. Here is what I have. RewriteEngine On RewriteCond %{HTTP_HOST} !^http://example.site.net$ [NC] RewriteCond %{REQUEST_URI} !^/.*$ RewriteRule ^(.*)$ / [L] RewriteEngine On Rewri...

Forcing the www prefix with PHP/htaccess/mod_rewrite

Is there an easy way (preferably with htaccess and mod_rewrite) to force the browser to always access a site with the www. prefix (adding it automatically where necessary?) Thx. ...

htaccess; /search/?q=test to /test

I have a similar situation to the one described in the title. All that I need to do is map all requests in the form /search/?q=test to /test. This is because we are changing the way our search works to make it user friendly, but still want to allow for backward compatability (i.e. anyone that may have these links bookmarked etc). Howe...

how to redirect page if parameter set?

hey i want to make a thing but i need some help. ive got an index.php with codes. and i added "file" parameter to index.php. so i mean if "index.php?file=/folder/folder/picture.png" is set, go to file. if "file=" not set do not do anything. I get "file" parameter with $_REQUEST thingy. please help thanks.. ...

How do I disable directory browsing?

I want to disable directory browsing of /galerias folder and all subdirectories Index of /galerias/409 * Parent Directory * i1269372986681.jpg * i1269372986682.jpg * i1269372988680.jpg ...

PHP Redirect location with htaccess

In one of the page I have is where administrators are allowed, however, I use if the session isn't set, the header will redirect them to index.php and that method works. If I replace index.php with home which is for the htaccess which changes it to index.php but it gives an error in the browser This works: if(!isset($_SESSION['MEMBER'...

How to successfully Rewrite a URL with .htaccess

Hello. I am trying to rewrite mysite.com/broadcasts to mysite.com/feed so that it will show up in the location bar as "broadcasts" but actually go to /feed. Here is what I have in the .htaccess file: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^broadcasts(/)?$ /feed/ </IfModule> But this isn't working... I get a 4...

How to setup .htaccess to rewrite to different folder

I'm moving my site to a new host but I need to have my current server continue to handle requests (not all files can be moved to the new server). So I added a parked domain to my old server (old.mydomain.com) and I want all requests to it to be written to the files from the old site. My old site (mydomain.com) was hosted internally in a...

django urlconf or .htaccess trouble

Hello I am running my django project from subfolder of a website. Lets say the address where my project is meant to open from is. http://example.com/myproject/ the myproject folder is root folder for my user account. In that folder i have fcgi script that starts my project. The .htaccess file in the folder contains this: RewriteEngi...

Redirect/Subdomain with .htaccess

What i have currently: A wildcard dns record. So that every subdomain points to www.galop.gr A dynamically (php) generated .htacces file where i append the following code for every subdomain i want working: RewriteCond %{HTTP_HOST} ^fractalbit.galop.gr$ [OR] RewriteCond %{HTTP_HOST} ^www.fractalbit.galop.gr$ RewriteRule ^/?$ http://ww...

301 redirect on URL starting with a number

How can I 301 redirect any URL that starts with a number between 1 - 9999, for example domain.com/12/something/anotherthing domain.com/378/product/widgets domain.com/2560 ...

Why is my .htaccess file redirecting to full server path instead of relative path?

I've never had a problem with cakePHP before, but something's odd about this server and is causing the redirects in the .htaccess files to behave oddly. CakePHP uses mod_rewrite in .htaccess files to redirect requests to its own webroot folder. The problem is that the redirects are listing the wrong path and causing a 404 error. My Cake...

redirect into subdirectory AND out of subdirectory

hi folks i have a mod_rewrite redirection problem i cannot figure out. all requests from a specific domain get "silently" rewritten into a designated subdirectory. e.g. www.mydomain.net/hello.html retrieves the file in /net/hello.html. the following .htaccess (placed in my hosting root) achieves this perfectly: RewriteEngine on Rewrit...