1

I have my app in xampp/htdocs/zadanie and I want to create .htaccess which will redirect all requests from http://localhost/zadanie/[request] to app.php. By far I was trying with:

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

# Explicitly disable rewriting for front controllers
RewriteRule ^app_dev.php - [L]
RewriteRule ^app.php - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ web/app_dev.php [QSA,L]
</IfModule>

( for app_dev to only temporary, just to see what is really going on )

but all requests now are recognized as "/zadanie/[request]", not "/[request]". What should I change?

mmmm
  • 3,768
  • 9
  • 36
  • 63

1 Answers1

0

You should make the xampp/htdocs/zadanie directory your document root, or move everything in it to the htdocs directory.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • How can I do it? I tried to add "DocumentRoot /zadanie/" but than I have only Server error.. – mmmm Nov 09 '13 at 20:39
  • ummm i just realized that You are probably talking about apache files? And I have to do that from .htaccess, without moving all my files anywhere. – mmmm Nov 09 '13 at 20:47
  • @Mati the document root must be set in your server config, and it has to be a full physical path: `DocumentRoot /xampp/htdocs/zadanie` or whatever it is. – Jon Lin Nov 09 '13 at 21:12
  • so there is no way to do it from .htaccess file? – mmmm Nov 09 '13 at 21:37