.htaccess - htaccess execute root/index for www.domain.de/some -


i need figure out how can execute index.php on webspace root.

i have this:

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !=/favicon.ico rewriterule ^ /index.php [l] 

now have folder root/some/projects in projects php logics.

i wana browse www.domain.de/some , error:

forbidden

you don't have permission access /some/ on server.

because in root/some no php logic in. want executes root/index.php coz there cms right content www.domain.de/some , not root/some/index.php

anyone have solution?

thx

somewhere in web server configuration, there options directive, forbidding access directories, e.g.

options -indexes 

in .htaccess, explicitly don't rewrite existing directories, see rewritecond directive

  1. you can perform various file attribute tests:
    • '-d' (is directory)
      treats teststring pathname , tests whether or not exists, , directory.
rewritecond %{request_filename} !-d 

if remove condition, rule work directories too.


p.s., don't need

rewritecond %{request_uri} !=/favicon.ico 

because prevent rule existing files

rewritecond %{request_filename} !-f 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -