Apache Server configuration support - .htacess problem - directories changed into site-names

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > July 2007 > .htacess problem - directories changed into site-names





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .htacess problem - directories changed into site-names
Frank Ehrlacher

2007-07-13, 1:23 pm

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!

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com