.htaccess

.htaccess file. Can I block access to a directory without blocking access to the files within it?

I'm building a website, but I'm not entirely sure what to do with the .htaccess file. Say for example I have a folder called pages which holds all my pages, can i deny access to someone if they type in www.website.com/pages so that they can't see the directory? I've tried putting the .htaccess file in the pages folder with the "deny from...

.htaccess rewrite outputs undesired content. I think??

I am trying to rewrite a URL using .htaccess. I am running on Apache version 2.2.15. Contents of .htaccess: RewriteEngine on RewriteRule cars/(.*) cars/member_page.php?user=$1 RewriteRule cars/(.*)/ cars/member_page.php?user=$1 Contents of member_page.php: <?php echo $_GET[user]; ?> URL entered into browser: http://www.mydomain.c...

URL rewriting with mod_rewrite

The web server is Apache. I want to rewrite URL so a user won't know the actual directory. For example: The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11 Expected URL: piecework.mydomainname.com/en/11 I added the following statements in .htaccess: RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.myd...

Changing paths to images in Wordpress

I recently moved a friends blog onto his new web hosts but unfortunately the images are not working. This is due to the old host having the following path for images: http://www.example.com/blog/wp-content/uploads/2009/07/imagename.jpg The new host uses a different layout and has this path for the file: http://www.example.com/wp-cont...

htacces with two domains. Point domain1/folder to domain1/anotherfolder/

Hello I have a hotel with two domains. Now the customer want a redirect: domain1.dk/folder/ [nothing should happen] domain2.dk/folder/ -> domain1.dk/anotherfolder/ The two URL's above (domain1.dk/folder/, domain2.dk/folder/) does not exist in the navigation structure today. I am not sure if htaccess is the way to go when there are m...

How to replace all equal signs with forward slashes using htaccess

Is it possible to remove all instances of the "=" sign and replace it with the "/" sign. Using htaccess? ...

htaccess rewrite directory

I moved my website from the /v1/etc... directory to the /v2/etc... directory and would like to make a permanent redirect in htaccess. Can someone help me? ...

User specific URL Redirection With Lighttpd

Apache web hosts have a user-configurable ~/.htaccess file that allows local redirects, for example, www.awesomesite.com => www.awesomesite.com/launchmyawesomeapp.cgi In lighttpd I know there is a global /etc/lighttpd.conf file, but is there something local like the Apache htaccess file? thanks, joe ...

.htaccess setting is not working on Google Chrome

I am using CakePHP framework, it redirect everything to the app folder using .htaccess, and then I set up a WordPress blog in /news/ folder outside of CakePHP, so I don't want everything in /news/ to be redirect, so I modify the .htaccess, and here is the final version: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...

How do I do this simple 301 redirect from index.htm to root?

I've read various reference sites on redirection, and to be honest I understand very little. I currently have standard WordPress mod_rewrite redirect rules in my .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /in...

protect flash files

Hello Ive a website that create avatars for users and provide them with link for avatar to use it in their website or singuters etc , my problems is the website based on flash . the main page has 1 swf file that load other swfs used to create avatars , if someone knows the link for the these swf files he can download them which means h...

Mod rewrite with 3 parameters ?

Hello, I did tons of methods to figure out how to make this mod rewrite but O was completly unsuccessful. I want a .htaccess code that rewrite in the following method: /apple/upcoming/2 → /handler.php?topic=apple&orderby=upcoming&page=2 This is easy to do, but the problem is that all parameters are not required so the link has diffe...

install CakePHP on Mac osx: apache problems

First time cake user and I'm having real apache problems. For some reason the .htaccess is trying to find File does not exist: /Library/WebServer/Documents/Users but there is no such directory as Users. I have tried setting up the following also: /etc/apache2/extra/httpd-vhosts.conf <VirtualHost *:80 > DocumentRoot "/Users/username/...

newbie trying to write url rewite in .htaccess file

My site was under example.com/waha/. Now I move the site right under the root example.com. I want to 301 redirect all the old links like example.com/waha/notice/5803 to example.com/notice/5803. How can I do it? My current .htaccess file is below. <IfModule mod_rewrite.c> RewriteEngine On # NOTE: change this to your actual Statu...

What is the best solution for htaccess caching

I have found a number of articles such as this one that talk about using htaccess to cache images and files on your webserver. But which is best, why, and what is the best implementation of this? ...

ForceType text/html;charset=utf-8 in .htaccess is causing all externally linked CSS to stop rendering

I'm using: ForceType text/html;charset=utf-8 in my .htaccess file, but it's causing all externally linked CSS to stop rendering on their respective pages. So something like this: <link rel="stylesheet" type="text/css" href="somestyles.css" media="all" /> no longer works on the page using it. I've also been trying combinations of: ...

.htaccess redirect with other settings

I am using CakePHP framework, it redirect everything to the app folder using .htaccess, and then I set up a WordPress blog in /news/ folder outside of CakePHP, so I don't want everything in /news/ to be redirect, so I modify the .htaccess, and here is the final version: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...

Url rewriting issue

i have used the following code in .htaccess Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteRule ^company/aboutus$ aboutus.php [NC,L] RewriteRule ^company/contactus$ contactus.php [NC,L] RewriteRule ^company/careers$ careers.php [NC,L] RewriteRule ^/$ index.php [NC,L] the above code works but aboutus page loading...

using Drupal for 1 page of xhtml-css website.

Hi friends, after using own custom cms for over 6 years, I decided to go for Drupal from now on. I will use Drupal for all my works. I'm pretty new at Drupal, started just 2 days ago :D just a simple question; I have a simple xhtml-css site (5 pages), and client is asking cms for gallery page (xhtml for now). so is it possible to make...

Trailing slashes in rewritten urls

I'm probably being completely thick here but I can't seem to make an optional trailing slash work in my url rewriting I've seen Gumbos comment about excluding the file you are rewriting to exclude infinite recursion, but still having no joy. So for example I have this: RewriteEngine On RewriteCond %{REQUEST_URI} !^/index\.php$ Rewrite...