.htaccess

In htaccess if the like have as symbol '-' and same time the parameter also having '-' that time url is not working how to solve this ?

Example www.domainname.com/page-param1-param2.html ...it will work fine but www.domainname.com/page-param-1-param2.html ... here param one have the data like param-1 this time url is not working. How do I get this to work? ...

How to protect a file so it can only be accessed by java?

Okay I have a folder say... http://oldserver.net/file/index.jar How would I be able to protect the file "index.jar" from being downloaded from regular web browsers? I've seen this done before, I just want to protect it from being accessed from web browsers, and keep it strictly java download access only. What I mean by java download a...

Redirect entire site except one directory to a new site - apache .htaccess

I am trying to move my current site over to a new domain, except for ONE directory. Example: current site: oldsite.olddomain.example new site: newdomain.example So I know I can create an .htaccess redirect entry to do this, and it works, but I want ONE exception - I do NOT want to redirect a specific directory. I still want thi...

Is there a way for making the re-write rule exclude some folders?

I have this in my .htaccess file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress I want this rule to NOT run if the url has /Users or /Forums in the url. How can I do this? Upda...

How to Display Nice URL for Wordpress Category Page?

I have a site whose home page shows a single Wordpress category page. I'm using a custom theme and the index.php file there does a 301 redirect to "mysitename.com/?cat=3". This page is generated with an event calendar plugin and a lot of custom code. It works, but the displayed URL is "mysitename.com/?cat=3" which I'd prefer my visito...

cloacking url via .htaccess

so i read stuff about how apache's mod_rewrite does the trick but it seems to be too vague for beginners like me. lets say i wanted to mask site.com/userpage.php into site.com/ or site.com/userpage or even removing the get requests.. from site.com/userpage.php?query=yes into site.com/userpage.php or site.com/userpage how can i do tha...

Apache .htaccess query.

I am hosting a bunch of files on an Apache server. The files all have an extension of ".plugin" (i.e. filename.plugin ). The files are actually zip files with the extension changed. When downloading via Firefox the browser saves the file as "filename.plugin" which is great. However when using IE it somehow knows this is a ZIP file and...

htaccess question: Remove 1(!) param from URL query

Hi, my URL looks like page.html?L=0&a=1&b=2&c=6 OR page.html?a=1&b=2&L=0&c=6 OR page.html?a=1&b=2&c=6&L=0 I need to delete the L=0, where L can be either 0 or 1. But I need to keep all other params. How can this be done? ...

Why won't this simple RewriteRule work?

Hi All, This should be simple but I cannot figure it out. I have this very simple mod_rewrite rule and it just doesn't want to work. This is the entire contents of the .htaccess file. RewriteEngine On RewriteRule ^([A-Za-z0-9-_/\.]+)/?$ index.php?page=$1 [L] If I call the URL domain.com/foo it should rewrite it to index.php?page=foo....

php, apache & .htaccess: include php configuration file globally

hi, i have a php project which has a configuration file config.php that stores config information like database info, directories, etc. normally we would include this config file at the top of every php page like require_once(".../config.php); however, i have found a way to do this by creating a .htaccess file and include this: php_va...

htaccess mod rewrite - how to create virtual subdomains?

Hi, I would like to create virtual subdomains through htaccess in the following way. Entering: http://testuser.domain.com/1/2/3/ Should be processed as: http://www.domain.com/user.php?id=testuser&amp;var1=1&amp;var2=2&amp;var3=3 HOWEVER, this rewrite should not use user.php, but index.php, in case someone enters: http://www.dom...

How to disable proxy caching with .htaccess

I have a problem where corporate proxy servers serves up the page for different logged in users. I reckon I can solve this issue by disabling proxy caching. This page suggests including the following snippet in htaccess: ExpiresDefault A0 Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0" Header set Pragma "no-cac...

mod_rewrite: remove query string from URL?

Hi There, I'm trying to make the following redirection (301) using .htaccess *?page=1 redirects to * (where * is a wildcard). Basically, I just want to prevent anyone accessing a page with ?page=1 at the end of the URL, and instead direct them to the same url minus '?page=1'. Is there a quick way of doing this? Many thanks! ...

.htaccess automatic redirects

How to do the automatic redirect in .htaccess my urlrewrite worrking fine , i want to redirect automatically if user enter the url as query string , i dont want to display query string any time, if query string meets the urlrewrit syntax, then system should automatically redirect this is my snippet RewriteRule ^index/result_...

How to specify named subfolders in htaccess?

Hiya, I have a folder structure like this /img/products/{product name}/ and then the sub folders hi, low, and thumb. I want to use htacess to force-download any files in a 'hi' or 'low' subfolder (but not 'thumb'). I was hoping something like this would work: <FilesMatch "\(.*)(\/hi|\/low)(.*)"> ForceType applicaton/octet-stream </Fi...

.htaccess & wordpress site - How to add 301 redirect rules for no longer valid permalink?

I recently did a big update on my wordpress site, thus some old permalink are invlid now. Seach google for a tutorial on this and found a lot about static html page redirection examples or specific php page which are not what i'm looking for Both my old and new permalinks are in path format, for example, i need redirect a couple urls o...

Redirect PageRank and cannonical status only from one site to another.

My question is a follow up of Redirecting URLs temporary with htaccess which was solved thanks to the SO community. I realized that I have a 2010 version of my site and a 2011 version which is about to launch. Both share a same structure but content is different and will be archived as such (not a archived category) because it is a fashi...

Remove IP address from Query String using HTACCESS

I have a URL like so: http://example.com/one/?ACT=123&amp;gateway=mygateway&amp;method=mymethod&amp;orderID=303&amp;currency=EUR&amp;amount=11&amp;PM=CreditCard&amp;ACCEPTANCE=test123&amp;STATUS=9&amp;CARDNO=XXXXXXXXXXXX1111&amp;ED=0517&amp;CN=Test+test&amp;TRXDATE=08%2F12%2F10&amp;PAYID=7963938&amp;NCERROR=0&amp;BRAND=VISA&amp;ECI=7&a...

admin area in sub directory

I have a system that has both a front end and an administration area. currently i am giving the admin area a subdomain. what i'd like to do it have it as a sub directory, e.g http://domain.com/admin but the admin area is set up to be placed in root. can i put something in my .htaccess to make the sub directory "/admin" think its the ...

Deny ajax file access using htaccess

There are some scripts that I use only via ajax and I do not want the user to run these scripts directly from the browser. I use jQuery for making all ajax calls and I keep all of my ajax files in a folder named ajax. So, I was hoping to create an htaccess file which checks for ajax request (HTTP_X_REQUESTED_WITH) and deny all other re...