Click here to Skip to main content
Rate this: bad
good
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 2

hi,
Just put a blank .htaccess file on that folder.
Thanks
  Permalink  
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 at 24-Jan-13 5:01am
   
hi Vyacheslav Voronenko,
Can you give with example, because I never ever use .htaccess file earlier.
Thanks
Vyacheslav Voronenko at 24-Jan-13 5:56am
   
Smth like
 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

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

  Print Answers RSS
0 Dnyaneshwar@Pune 604
1 OriginalGriff 394
2 thatraja 370
3 Sergey Alexandrovich Kryukov 334
4 CPallini 219
0 OriginalGriff 697
1 Dnyaneshwar@Pune 604
2 Kornfeld Eliyahu Peter 495
3 thatraja 370
4 Sergey Alexandrovich Kryukov 344


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
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