.htaccess

Open dot-file with dialogue in OSX

Since the GUI-side of OSX treats all dot-files (such as .htaccess) as hidden, it doesn't display them in any of the graphical UI:s, e.g. Finder or the Open-dialogues. How can I open a dot-file (.htaccess in this case) in a graphical editor, without doing that thing for all hidden files, universally and without going through Terminal.app...

.htaccess Redirect to script in subdirectory...

I need to have a .htaccess rewrite rule redirect to a script in the root of a subdirectory, but only for any files/directories in that sub directory... / /subdir/ /index.php /somedir/ /anotherdir/ For the structure above, I want anyone browsing to /subdir to go to /subdir/index.php, and anyone going to /subdir/somedir/ to /su...

Boolean AND in .htaccess

Well I am using the following code to redirect users who don't have my IP to a coming soon page: rewritebase / rewritecond %{REMOTE_HOST} !(^1\.2\.3\.4) rewritecond %{REQUEST_URI} !/comingsoon\.html$ rewriterule .* http://www.andrew-g-johnson.com/comingsoon.html [R=302,L] I want to make it so that I have two IP's that are allowed, an...

Redirect all .php traffic to .php5 files

Hi, I have a personal website with a MediaWiki installation on a shared host. The Apache configuration treats all .php request with PHP 4, and all .php5 requests with PHP5. For compatibility reasons I need to be able to use the .php extension, but MediaWiki is only available on PHP5. I tried to use the mod_rewrite engine, but I'm stuck...

Get the URL string a user entered when using .htaccess

I'm currently using an htaccess file to redirect users from detail.asp?CategoryID=XX&SubCategoryID=XX&ProductID=XX to catid-XX-subcatid-xx-productid-xx but I now need to check they've arrived at the correct page. I'm doing this by checking that the query string values are correct. However I'd rather check that the user arrived at "...

How to translate /en/file.php to file.php?lang=en in htaccess Apache

I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php And would like to add language support by placing language code into URL like this: http://mywebsite/en/index.php would redirect to: http://mywebsite/index.php?lang=en And http://mywebsite/en/files.php would redirect to: ...

htaccess redirect for everything but files/directories

I am trying to create a rewrite rule that accomplishes two things: Redirect (www.)?domain.com to log.domain.com Let any other directory or file request on domain.com through without redirection This not an Apache server (it's LiteSpeed), but supposedly it supports .htaccess files wholly. This was my shot at the rule: RewriteEngine...

.htaccess with or without slash

What do I need to do to the following rewrite rule to make it so it works whether or not their is a slash at the end of the URL? ie. http://mydomain.com/content/featured or http://mydomain.com/content/featured/ RewriteRule ^content/featured/ /content/today.html ...

How do I use .htaccess to redirect an aspx page to a php page?

I recently moved from a asp.net host to a PHP host. I am trying to setup 301 redirects of my old urls using .htaccess. Here is what I want to accomplish: old url: http://www.vasanth.in/downloads/download.aspx?file=file.zip new url: http://www.vasanth.in/downloads/download.php?f=file.zip I tried the following: RedirectMatch 301 /downl...

Remove all query strings from requests for particular page.

I have a flex application that for some reason I do not know why, when you are using google chrome and access the page with any query strings in the URL the applications behaves unexpectedly. The page does not need query strings though. But many things like adwords etc are passing variables in query strings for tracking purposes. But f...

Apache mod rewrites giving 404 error

Hi, I'm trying to set up a simple rewrite rule to convert a url such as: "index.php?page=login" to something like "page/login" However, I keep getting 404 errors. Can anyone suggest why the following might not be working? .htaccess: RewriteEngine on RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L] rewriteEngine off I'm qui...

Use htaccess to redirect all traffic from root to specific subdomain page

I have a site that has been up for some time. I had a blog on a subdomain for some time. I have decided to do away with the main site and just support the blog subdomain. I have a redirect setup for this, but it carries all the extra parameters through to the blog which results in a file not found page appearing. I just want the redi...

How do you restrict access rights to your clickonce web repository ?

I've built and successfully deployed a ClickOnce application. The repository url is at http://mywebsite.com/Install The application successfully updates when needed, and everything works fine. However, I don't like the fact than everybody on the internet can access the files freely (even if he's not one of my customers) Since I have o...

.HTACCESS File causing Internal Server Error

I have copied the files and database from BradPPresents.com to BradP.com. The .htaccess file is required to get pages to display properly since "Pretty URLs" are enabled by joomla!. You can see that the database and all connections are working at http://bradp.com/index.php, however http://bradp.com/home.html does not work as it relies...

Problem redirecting 403 Forbidden to 404 Not Found.

The pertinent part of my .htaccess looks like this: Options -Indexes <FilesMatch include> Order allow,deny Deny from all </FilesMatch> RedirectMatch 404 ^/include(/.*)$ And it's generating the following responses: /include 403 /include/ 404 /include/config.inc 403 I can tell by looking at my pattern that problem is l...

Redirect all IPs except those whitelisted

I want to protect some subdomains from the public. Restriction should be done against a whitelist of IPs. Infinite loop due to the redirect is not a problem as its not the www-domain. I tried this http://discussions.apple.com/message.jspa?messageID=2411725, but couldnt get it to work. However I did try this first RewriteEngine on Rewr...

Wordpress permalinks: only using the post_id from the URL

I'm trying to have SEO friendly URLs for my wordpress blog, while still having the flexibility to change a post's title at will. My permalink structure would be like this: %post_id%/%postname% However, I'd like wordpress to just consider the %post_id% from the URL when looking for the appropriate post (sort of like here on stackov...

PHP Rewrite Rules

The actually URL which my app uses is: http://site.com/search.php?search=iPhone but I would like it to be possible to achieve the same with http://site.com/iPhone I have no experience of rewrite rules, how can I set this up? The solution has worked but the new URL is displayed in the address bar. I thought it would have been poss...

Why would .htaccess fire twice in IE when downloading a protected XLS file?

Certain directories are protected by Basic Auth using a .htaccess file on an older Apache 1.x server. Today a user pointed out that the username/password was requested twice for the file he had just posted - once when entering the directory to see the index, and then AGAIN when downloading the file. Finding this odd, I researched the usu...

Why is my .htaccess www. force causing external forms to fail without www.?

Hello there, Because of strange cross domain AJAX problems, causing AJAX requests to fail when not using www.(the PHP handler communicating with the request is given in a relative path, so it can't be an address issue or something - that's what this question is about though), I have forced www. using .htaccess : #enable rewrite engine ...