Where is an error?

New to mod_rewrite? This is a good place to start.

Where is an error?

Postby DFX » Wed Nov 05, 2003 8:57 am

Hi!

Task: need rewrite url's like ....../dir/somepath, ....../dir/somepath/ and ....../dir/somepath/index.html in order to transparently execute php script (to dynamically produce pages which does not exists).

In "dir" .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^(([^/\.]+|[^/]+/|[^/]+/index\.html))$ script.php?d=$1 [T=application/x-httpd-php,L]

On requesting ....../dir/somepath and ....../dir/somepath/ all ok. But when requesting ....../dir/somepath/index.html I'll get ....../dir/somepath/somepath/index.html/ (somepath twice, and '/' at the end) and, of cause, 404.

Where is a mistake?

Thanks in advance.
DFX
 

Postby Guest » Wed Nov 05, 2003 10:11 am

...solved...problem was in script.php.
Guest
 


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 12 guests

cron