I recently rearranged some of the files in the PyMOTW section of my site, renaming PyMOTW/atexit/atexit.html to PyMOTW/atexit/index.html for example. I wanted to create an Apache RewriteRule to fix all of the references to those pages, but didn't want to list them all manually.
I ended up with this rule:
RewriteRule ^/PyMOTW/(.*)/\1\.html$ /PyMOTW/$1/ [L,R=permanent]
That bit in bold, the \1, is what I had trouble with. I kept trying variations of $1 because, well, that's what I used in the second part of the rule. Oh, well.
0 comments:
Post a Comment