.htaccess

How do I create a regular expression to negate a string but include anything else.

I'm trying to create a regex for apache that will ignore certain strings, but will use anything else. Ive tried many different methods however i just can't seem to get it correct. for example i want it to ignore ignore.mysite.com but anything else i want it to use *.mysite.com ...

How to access the default index page after using DirectoryIndex in .htaccess

My site root is an english version of the site (/index.php). I used an DirectoryIndex to point my users to a french version of the site by default (/fr/index.php). I would like people to be able to click an link that would take them to the english version (/index.php). Is there anyway to do this without changing the folder structure? ...

htaccess Redirect using regex

Hi, I Want to redirect some pages as follows http://www.example.com/old/thispage1.html to http://www.example.com/new/this-page-1.html Please suggest. Thanks ...

ErrorDocument that points to the ZF controller

Hello, I have Zend Framework based application and I need to create combo .js files. So, folders tree is: /myuser/apps/zfapp_write /myuser/apps/zfapp_write/combos /myuser/apps/zfapp "zfapp_write/combos" folder contain .htaccess file with content like ErrorDocument 404 /myuser/apps/zfapp/combos/get-combo Thats why if I'll open lin...

ErrorDocument doesn't set REDIRECT_QUERY_STRING server variable

Hi, When I tried to open not existing page .htaccess redirects me to ZF controller, but $_SERVER['REDIRECT_QUERY_STRING'] variable not setted. Any ideas? ...

Redirect site with .htaccess but exclude one folder.

Hello all! I want to 301 redirect an entire website, but exclude everything in a folder called 'uploads' which exists in the root directory. I have googled for this, but didn't come up with anything, or I didn't think what I saw was right. Can we crack this? ...

How to prevent users from accessing files on server ?

I have an application that let users to upload files to server. All files are stored in one directory called Uploaded Files (which has Thumbnails directory inside). What are the most common ways for preventing users to see these files ? I mean I don't want users to see the files by typing URL like /path_to_website/Uploaded Files/1.png. ...

frameset htaccess index.php url routing

hello, My question ist about htaccess redirecting everything to bootstrap.php. My index.php is just pure html about a frameset (i know frames are uncool, but I must). So I redirected everything in the htaccess to bootstrap.php and now am trying to build a URL-Router. But somehow, it does not work. When i request an URL like f.e. http:/...

wordpress test site goes to main site url...how to solve?

For example I have a live WP site http://wpsite.com I wanted to make a live mirror copy of http://wpsite.com at http://wpsite.com/test/ so i copied all data of public_html/ folder to public_html/test/ then i checked http://wpsite.com/test/ but everything is going to http://wpsite.com/ is there any .htaccess problem? This is .htacces...

htaccess help needed

I need a htaccess , which will do the following logic: http://sitename.com/app will go to http://sitename.com/app/index.php http://sitename.com/app will go to http://sitename.com/app/index.php http://sitename.com/app/a/b/c will go to http://sitename.com/app/index.php/a/b/c http://d.sitename.com/app will go to http://site...

How to usually .htaccess file when it is hidden in ftp

I usually cannot see .htaccess file because it is hidden, when I login to remote servers with ftp access. Since I don't have shell access, I usually perform the following steps to edit the file: I change the settings on my mac (from terminal) to see invisible files I open .htaccess file on a standard drupal installation and I edit it I...

Adjusting a php function so that it displays link in the form of:- '/widgets?pg=2' instead of 'products.php?cat=20&pg=2'

I added the following .htaccess rule:- RewriteRule ^widgets$ products.php?cat=20 [QSA] So now I have a simple link called 'widgets' which leads to the 'widgets' category 1st page. However, the links to the 2nd page looks like the following:- products.php?cat=20&pg=2 What I would like is for the subsequent pages to be rather in th...

Safari seems to ignore cache settings when user hits back with mouse or keyboard.

I have a page where once a button is clicked, it is replaced by an Ajax spinner whilst the user waits for the next page to load. I am controlling (or attempting to control) caching using .htaccess. If the user hits back (browser button, mouse button, alt+left, backspace) it needs to reload the page from the cache. IEs 6-8 and Chrome wer...

.htaccess : languages redirection

Hi everyone, I'm trying to redirect visitors of my blog to either the french or the english version. So I made this .htaccess : <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #--------------------- # Language Redirection #--------------------- # Checking if the redirection didn't occur yet # Checking that the url doesn't begin...

Using htaccess to rewrite subdomain

I am using the Zend Framework and have setup a MVC application, so my site's URL is like: domain.com/module-name/controller-name/action-name/?other=stuff Now I'm trying to make it so that you can access this through: module-name.domain.com/controller-name/action-name/?other=stuff The key is also that it shouldn't redirect, I want the u...

WHMCS htaccess to allow downloading.

With WHMCS you can't download files if using HTTPS. E.g. The following line DOES NOT WORK: https://www.mysite.com/client/dl.php?type=a&amp;id=239&amp;i=0 However, this works: http://www.mysite.com/client/dl.php?type=a&amp;id=239&amp;i=0 So, my question is, how do I add a redirect rule to the following: RewriteCond %{HTTP_HOST} !sv...

htaccess RewriteRule problem

Hello, I have a problem with RewriteRules. I'm currently using this rule: RewriteRule ^([^/.]+)/?$ index.php?clip=$1 This works fine for links as these, where $_GET['clip'] is the value after the slash: http://example.com/abcdefg But not for those with a dot character, like these: http://example.com/abcdefg.png How should I chang...

HOW to rewrite links like this?

I have a link, let's say: http://site.com/profile.php?id=1 ....In a normal mode, with a normal rewrite I'd have something like: http://site.com/profile/1 . But,...What I want is.....how can I get from the database the username that belongs to the user with the id 1 and make the url http://site.com/profile/FinalDestiny ? Thanks, ...

URL rewriting apache

I would like to rewrite two urls on my website so as they are more search engine friendly. How can I do this in my .htaccess? For the first I tried this, but got 404 errors: RewriteRule ^research/([0-9][0-9])$ /research/$1/ [R] RewriteRule ^research/([0-9][0-9])/$ /urt.php?func=viewresearch&rid=$1 RewriteRule ^research/([0-9])$ /resea...

help with mod-rewrite for REST API (kind of like the twitter API)

I've got a question for the mod-rewrite gurus out there :p I've got a REST api built, I'm just working on the .htaccess mod-rewriting for some nice URLs. I would like this... api.site.com/[contacts].[json]?location=[new york,NY] To map to this... site.com/includes/api/v2/api_receiver.php?action=[contacts]&format=[json]&location=[new y...