symfony - Redirect url with .htaccess -


i m sure many people duplicated try other "question"`s , nothings work me.

the problem move project web server. in server have folder "public_html" project symfony. enter on project must write following url: www.mydomain.com/symfony/web/* want write rewrite rule redirect www.mydomain.com/symfony/web/* www.mydomain.com/home/*.

to try on 2 different ways many combination of rewrite rule.

  1. in public_html create .htaccess folder
  2. i edit .htaccess in symfony/web folder

i add following rule in both file without success

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /  rewriterule ^symfony/web/(.*)$ www.mydomain.com/home/$1 [l,r=301] 

unfortunately without success. i`m doing wrong?


my htaccess file like

and time error 404 object not found

symfony/web/.htaccess

directoryindex app.php  <ifmodule mod_rewrite.c> rewriteengine on rewritebase /symfony/web/  rewritecond %{the_request} \s/+symfony/web/ [nc] rewriterule ^(.*)$ /home/$1 [l,r=301]  rewriterule ^home/(.*)$ $1 [l,nc]  </ifmodule> 

it`s redirecting me receive again object not found :( delete .htaccess in public_html folder root 1 server

public_html\.htaccess

rewriteengine on rewriterule ^home/(.*)$ /symfony/web/$1 [l,nc] 

1: place code in /symfony/web/.htaccess:

rewriteengine on rewritebase /symfony/web/  rewritecond %{the_request} \s/+symfony/web/ [nc] rewriterule ^(.*)$ /home/$1 [l,r=301]  rewritecond %{request_filename} !-f rewriterule ^(.*)$ app.php [l] 

2: place code in /public_html/.htaccess:

rewriterule ^home/(.*)$ /symfony/web/$1 [l,nc] 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -