Click here to Skip to main content
12,399,799 members (49,784 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: PHP
hi,
I am using .htacces file in which i put the redirection
as
if anyone put www.mysite.com/index.php
will redirect to www.mysite.com.
now i have a directory name support.
so the url is www.mysite.com/support/index.php.
what i want is simply not redirect
www.mysite.com/support/index.php to www.mysite.com/support.

If anyone of you know the solution then please let me know.

Thanks
Posted 23-Jan-13 21:47pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Typical approach is to use RewriteCond in combination with rules. In example below,
RewriteRule is ignored, if on this path exists file (-f) or directory (-d)

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

More details and examples are present in the documentation

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html[^]
  Permalink  
v2
Comments
Rajeshkrathor 24-Jan-13 5:01am
   
hi Vyacheslav Voronenko,
Can you give with example, because I never ever use .htaccess file earlier.
Thanks
Vyacheslav Voronenko 24-Jan-13 5:56am
   
Smth like

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

hi,
Just put a blank .htaccess file on that folder.
Thanks
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100