.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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -