This is a discussion on .htacess problem - directories changed into site-names within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, and sorry for my english first. I'm using .htacess to rewrite dynamic php-sites into static ones (htm) ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
and sorry for my english first. I'm using .htacess to rewrite dynamic php-sites into static ones (htm) Example: dir1/sideXY.htm ist redirected to site.php?id=XY using (.htacess in dir1): RewriteEngine on Options FollowSymLinks RewriteRule ^site(.*)\.htm$ /dir1/site.php?id=$1 [L] This works perfectly. Now I wanna have rewriten "virtual" directories ... Example: dir1/dirXY/ should be rewritten into /dir1/site.php?id=$1 [L] At the same time "old" requests to dir1/sideXY.htm should be rewritten to the new dir1/dirXY (via 301) too. What I tried is (changed .htacess in dir1): Options FollowSymLinks RewriteRule ^side(.*)\.htm$ /dir1/$1/ [R=301] RewriteRule ^dir1/(.*)/$ /dir1/site.php?id=$1 [L] The first line works, /dir1/sideXY/ appears in browser's URL-field. But then it gets a "404" "Side missing" - so the 2nd line doesn't seem to work? Is there one thing I didn't see? Thanks for Your help! |