nickleefly
nickleefly

Reputation: 3753

How to change htaccess to access symfony web directory

I am running symfony2 in Windows7 and Xampp:

http://localhost/symfony/web/app_dev.php/hello/symfony

How do I change web/.htaccess file to access symfony using the link below?

http://localhost/app_dev.php/hello/symfony

the default .htaccess is:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]

I tried adding Rewrite RewriteBase /symfony/web/ or RewriteBase symfony/web/ then php app/console cache:clear --env=prod --no-debug and also tried restarting apache.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
RewriteBase /symfony/web/ OR RewriteBase symfony/web/

And can I do the same in Nginx with Reverse proxy? How to change to access without symfony/web?

Upvotes: 3

Views: 5029

Answers (1)

nickleefly
nickleefly

Reputation: 3753

tried add 127.0.0.1 www.mysymfony.com.localhost into etc/hosts add the following into httpd.conf

# Be sure to only have this line once in your configuration<br>
NameVirtualHost 127.0.0.1:80

# This is the configuration for your project
Listen 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
  ServerName www.mysymfony.com.localhost
  DocumentRoot "D:\xampp\htdocs\symfony\web"
  DirectoryIndex app.php
  <Directory "D:\xampp\htdocs\symfony\web">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

access this link http://www.mysymfony.com.localhost/app_dev.php/demo/hello/symfony it gives an error,doesnt have this link

Upvotes: 1

Related Questions