1

On my computer I have an Apache server with rewrite and userdir modules enabled.

The website is located in /home/pedro/Dropbox/www/cocina/ and the webserver root is /home/pedro/Dropbox/www/

If go to http://localhost/~pedro/cocina/index.php the website shows ok.

In my .htaccess I have the following:

RewriteEngine On
RewriteBase /~pedro/cocina/
RewriteRule ^receta/([^/]*)/([^/]*)\.html$ /index.php?receta=$1&desc=$2 [L,PT]

But when I try to open http://localhost/~pedro/cocina/receta/1234/blabla.html I get a 404 error (index.php not found).

Looking at mod-rewrite logs I can't see any problem:

rewrite 'receta/1234/blabla.html' -> '/index.php?receta=1234&desc=blabla'
forcing '/index.php' to get passed through to next API URI-to-filename handler
trying to replace prefix /home/pedro/Dropbox/www/cocina/ with /~pedro/cocina/
internal redirect with /index.php [INTERNAL REDIRECT]

Where's the problem?

note: If I set up a v-host instead of using userdirs, the redirect works fine.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
Peter
  • 5,138
  • 5
  • 29
  • 38

1 Answers1

0

try using this:

RewriteRule ^receta/([^/]*)/([^/]*)\.html$  index.php?receta=$1&desc=$2 [L,PT]
undone
  • 7,857
  • 4
  • 44
  • 69