Sunday, 15 March 2015

php - Permanent redirect to subfolder with .htaccess -



php - Permanent redirect to subfolder with .htaccess -

i'm setting symfony2 project on shared host , i'm having issues getting things done. symfony2 default has dispatch controllers or main files (what in many scheme file index.php) within /web directory if move project public_html on shared hosting won't works until append /web end on url. bad , noise users since know page it's domain. i'm trying create redirect using .htaccess follow:

//301 redirect entire directory redirectmatch 301 /(.*) /web/$1 //prevent directory listings options -indexes

but it's not working since hosting said lines bad in .htaccess file, how can ride of problem?

in root .htaccess can utilize mod_rewrite rule:

//prevent directory listings options -indexes rewriteengine on rewriterule ^((?!web/).*)$ /web/$1 [l,nc,r=301,ne]

php apache .htaccess symfony2 redirect

No comments:

Post a Comment