.htaccess

HTACCESS Redirect folder

All, I want to redirect all traffic that comes to http://mysite/ to http://mysite/public folder. Currently I am doing this using the below in an .htaccess file and it works for the root directory. But if I browse to http://mysite/application, it doesn't redirect and shows the directory listing. I want all traffic regardless of what fold...

.htaccess regular expression need to make trailing forward slash optional

I need to include an optional trailing forwardslash, that's an /, in my RewriteRule What I have so far is RewriteRule ^([a-zA-Z0-9]+)$ u.php?$1|$2 Which works fine, for example http://foo.bar/abcde will redirect to http://foo.bar/u.php?abcde and handles any querystring parameters that may be present. What I need to do is take http:/...

CodeIgniter URL rewriting problem

Hey everyone, So basically I have the same problem described here and there. I tried everything described (and much more...), but anyway. Here is my .htaccess : RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] I tried various things, like add...

Redirect user to a directory using mod_rewrite - Simple question

Hi, I'm trying to do so if the user going to this url: http://www.abc.com/ it will redirect him to http://www.abc.com/minisite/ or, if he's going to tihs url: http://www.abc.com/dir/something.php it will redirect him to: http://www.abc.com/minisite/dir/something.php I'm trying to do this in Mod_Rewrite... Here is what I've wrrite...

How to rewrite paths on single SSL secured subdomain to secure web apps on other subdomains using htaccess

Let's say I have an SSL secured domain at secure.domain.com. I also have a web application (using silverstripe) at www.domain.com and another at app.domain.com (using CakePHP) I would like specific areas of www.domain.com and app.domain.com to utilize SSL, and thus must somehow rewrite the paths using the subdomain with the installed S...

301 redirect match problem

Ok I am serving two domains off of one box. The domains are: www.old.org and www.new.com. As it is now, all of the files and dirs are the same on both domains. I want to make it so that IF someone goes to www.old.org/folder_a/file_b.php they are 301'ed to www.new.com/folder_a/file_b.php. I've already tried in the htaccess: Redirect...

keep alive feature in .htaccess

hi i want to use keep-alive feature of apache how can i use that with my host (.htaccess) and what should be the best values for the parameters like KeepAliveTimeout Thanks ...

Apache fails when I pass an URL as an argument

Hey everybody, Im really confused about this problem. Ill try to describe it: The problem is: http://mydomain.com/somedir/somephp.php?arg1=value&arg2=http://otherdomain.com&arg3=http://othertoo.com/somepath/something... totally fails. With and without url encode. My site reads in everything after mydomain.com/everything, except...

Server opens /search.php instead of /search/

Ok, i have a simple .htaccess for my engine. It simply rewrites all requests to index.php (much like Wordpress does). RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Now, i've run into an issue. I have search.php, which should be included with index.php. But, when i try to open exam...

How to use authlogic to restrict access to static files/documents (such as .PDF)

I have a very simple Ruby on Rails app which uses acts_as_solr plugin to index and search PDF files. The basic idea of the app is: all PDF files located in myRoRapp/public/PDFfiles/example.pdf are full-text search-able. Usage of the webapp returns links to all PDFs that meet the search criteria. The app is user authenticated using nift...

.htaccess mod_rewrite help

Hi, noob when it comes to .htaccess. I need a mod_rewrite of a URL. URL example is as shown: http://example.com/folder/script.php?location=UK&Name=Fred I want it to transform to: http://example.com/folder/UK/Fred ...

.htaccess gone for deleted, permalink database entries

Hi Gang, I have event entries in a php application with a permalink structure for the events. I'm creating a dynamic xml sitemap for google et al. which creates new url nodes as events are added, and when an event is in the past, the priority level automatically gets adjusted downward. My question has to do with 404 not found errors...

.htaccess ModRewrite question

trying to do rewrite rule for this: http://website.com/checkreg/34324234 <--- Old URL Location to this: http://website.com/chkreg.php?checkreg=34324234 <--- New URL Address I've tried the following, but it causes an error 500 message, I don't know enough about ModRewrite to figure out the issue. # BEGIN WordPress IfModule mod...

.htaccess rules with a second domain to use a different directory than root?

Domain1 uses root / I am trying to have Domain2 use /domain2 When I visit domain2.com, I want it to appear as domain2.com and use the files from /domain2 instead of root / The closest I got was: RewriteEngine on RewriteCond %{HTTP_HOST} ^domain2\.com$ [NC] RewriteRule ^/?$ /domain2/$1 [L] But if I try to go to some page at doma...

how i can do this by .htaccess

i have 2 line want make it one line and do the same job RewriteRule ^account/?$ account.php RewriteRule ^account/(.*)/?$ account.php?mod=$1 how i can do it ...

Apache shows .htaccess for some sites

Hello, I've setting in httpd.conf to restrict access to .htaccess files for all sites and it's working for most of the sites. Unfortunately, I can see .htaccess file from web browser at one of my sites. What can be the reason for that and how can I avoid it? Thanks in advance. ...

Auto-redirect requests from /dirname to /dirname/

Could somebody assist me in formulating the following .htaccess rule: if an incoming request contains a top-level directory path like www.example.com/dirname automatically convert this to www.example.com/dirname/ but only for the top level, so requests to www.example.com/dirname/subdirname remain untouched. Do I need mod_re...

How can I make the -f flag apply to directories with a trailing slash?

I am building a .htaccess file with a fairly complex ruleset. One of the basic rewriting rules is this first line: If a requested file exists physically, no rewriting, stop processing rules. RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule . - [L] this works well with one exception: When I acces...

Cleaning up nested mod_rewrite statements

I am cleaning up a large .htaccess file containing a lot of mod_rewrite statements. The biggest part of the clutter comes from statements catching various occurrences of /directory1 /directory1/directory2 /directory1/directory2/directory3 using statements like RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)$ RewriteRule .* /front....

.htcaccess redirect ONLY root ("/") to sub folder

I have a site that is arranged thus: /about /css/ /index/index.php /js/ /index.php index.php uses a PHP redirect to index/index.php I want to create a .htaccess rewrite rule so that when the root is accessed, /index/index.php is displayed BUT /about etc. stays the same. ...