.htaccess

.htaccess to forward url and exclude one page

How to write a .htaccess that has in result: ALL Requests on that domain go forwarded to the index.html at the rootfolder of the same domain. The index.html itself is not forwarded (excluded) as it includes 2 outbound links. thanks chris ...

httaccess primary domain Ok, but addon domain be problem

I have primary domain www.a.com and addon domain www.b.com and .htaccess on primary domain root : <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteRule ^([A-Za-z0-9-()/&]+)/?$ direktori2.php?NamaToko=$1 [NC,L] </IfModule> when i acces www.b.com, error : Not Found The requested URL /home1/mydomain/publi...

htaccess rewrite

I use right now: RewriteEngine on RewriteRule !^index.html http://samedomain.com [L,R=301] so that all inquires go the http://samedomain.com ...(usualy it would load index.html) the index.html is excluded so it does not come a endless loop. i can open http://samedomain.com/index.html FINE.. it does not come redirected. And other re...

Doubt in Copying file and .htacess Rewriting

Now this is an example of a search on my website : http://engine.searchr.us/web-search.phtml?search=TEST+SEARCH Now,The first thing what i want to do is rewrite all the searches which are being done into something like this : (using .htacess) http://engine.searchr.us/web-search/search/TEST-SEARCH.html And the second thing is i want ...

How to diagnose .htaccess speed issues via RewriteLog

We have .htaccess setup to handle URLs like: http://www.oursite.com/events/Health/Insectology/343/346.html But clicking from such a generated page to: http://www.oursite.com/events/Anything/Anything/abc/abc.html Seems to reload the page completely (and not use the cached images). (This question is related to http://stackoverflow.c...

Htaccess accessing outside of the current directory

In my web root I have a .htaccess which uses a RewriteRule, for example: RewriteRule ^/t/([0-9]+)/$ ../list.php?id=$1 [L] Is this correct if list.php is in the folder below the current one? I can't find any information about this and it's currently not working, so I'm not sure whether it is either possible, or I am doing it wrong. Tha...

Conditional .htaccess for URL

RewriteRule ^photographs/?$ photographs.php [L] RewriteRule ^photographs/(.*)/?$ photographs.php?cat=$1 [L,QSA] RewriteRule ^photographs/(.*)/(.*)/?$ photographs.php?cat=$1&page=$2 [L,QSA] I need this to have options such as /photographs /photographs/category /photographs/category/3 Thanks ...

.htaccess redirect subdomain to main site - no exeptions!

Hi everyone, I'm trying to redirect all requests for example.domain.com to www.domain.com Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.domain.com/$1 [R=301,L] Seems to cause a 500 internal server error as does Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$...

Incorect redirection after omitting a trailing slash (.htaccess)

Hello, I have the following .htaccess file and I would like to know how can I edit it in order to add the trailing slash and keep the same url. Right now, if I access a link without a trailing slash, it adds the slash but it loses the 'www.' in front of 'mywebsite.com'. Any ideeas? Options +FollowSymLinks RewriteEngine On RewriteBas...

Help w/ .htaccess file

To enter my site users are required to enter their password in the .htaccess box that pops up. I also want to restrict access to the .svn directory. The password part is working fine but when I add the last bit about blocking access to anything under .svn I'm unable to access any page on my site :/ AuthUserFile /path/to/.htpasswd AuthTy...

301 redirects to migrate site to Code Igniter

Friends, I am working on a website in CodeIgniter. I want to launch it soon and after launching I don't want to loose the current indexes in Google. So I want to permanently redirect the existing website's URLs to the new SEO friendly CodeIgniter URLs. Existing website's URL: www.myapp.com/main.php?{param1}={value1}&{param2}={value2}&p...

Redirect not working for a drupal multisite installtion

I have a drupal mustisite installation and Im using drupal domain access module. I have sites like www.abc.com and www.cde.com pointing to the same codebase. However, while redirect for abc.com to www.abc.com works, redirect for cde.com to www.cde.com doesnt work? Any idea on how to fix it? Im redirecting using htaccess. ...

Redirects in Drupal for index.php and home in htaccess

Hi All, I have been trying to create redirects for /home and /index.php to the site's base url. I have tried following rules in htaccess but without any effect RewriteRule ^(.*)\index.php$ $1 [R=301,L] RewriteRule ^home$ / Im new to it so kindly bear with me if its a trivial question for the experts Thanks in advance to the wonderf...

htaccess 301 redirect certain URL pattern

Hi I'd like to redirect: http://site.com/FOO/BAR/BAZ to http://site.com/FOO/NEW/BAZ so, subsitute the second segment in my URL with a new one. ideally I'd like to use HTACCESS and a 301 as these pages have permanently moved. The URL structure will not change. Ideally there won't be a query string, but doesn't matter too much is ther...

htaccess to escape percent (%) from URL

Hi All, Having percent sign inside URL, returns bad request (error 400) to the browser. I have file name that have percent (%) sign, resides at server. Original File name: 204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1,2%.pdf Url in browser after clicking on download link: http://www.example.com/204153_20090605_Aluminiumace...

Prevent Hotlinking through CSS via .htaccess

I've set up my htaccess this way to block hotlinking: RewriteCond %{HTTP_REFERER} !^http://(.+.)?mydomain.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*.(bmp|dtd|flv|jpeg|jpg|gif|png|psd|swf|tif|txt|mov|mpeg|mp3|xml)$ - [F,NC,L] The problem is that it works perfectly fine via HTML (such as < img > tags) but it doesn't prevent...

Deter direct access to files (mp3) but yet allow flash player to play songs (htaccess/php)

I know it's practically impossible to not allow a user to download an mp3 file with all the various methods out there. But I'm stuck in a situation where i need to make things slightly more private/secure for my customers. Here's my problem, I'm currently using this flash mp3 player http://www.flabell.com/flash/Flash-Mp3-Player-29 to st...

Replace %26 in htaccess to something else

Hi all, Basically I'm importing a bunch of pages that have ampersands in the title, from Mediawiki. These are encoded as %26. Drupal, for various reasons, has decided double encode the url it to have it become %2526. I simply can't create the alisis within Drupal so I have to use htaccess tl;dr: I need example.com/something_%26_else ...

Problem with Wordpress permalinks and mod_rewriter

Hi there, first off...thank you so much for your time. I was referred to you guys and heard here's the best place to find a solution. Ok...so here's the problem. My old programmer set up the wordpress permalinks to be dynamic, but we all know that they are the worst to pull in traffic from search engines (specially google). So I need...

Use mod_rewrite to redirect from folder to index.asp file, if such file exists

Hi there, I'm using Rackspace's Cloud Sites as a webhost and, for a site that uses both PHP and ASP, they have a funny setup. On our setup, PHP is the default technology, and so the site by default runs Apache, until it hits a URL ending with the .asp extension. That means this URL: www.site.com/folder/ Will not automatically load: ...