views:

152

answers:

1

It's been a while since I've done anything with mod_rewrite, so I was hoping I could help some help on this.

I would like a URL like this: http://example.com/qwerty/xyz/ to be directed to querty.xyz.php, where the number of slashes and alpha characters between the slashes is not explicitly set.

A: 
RewriteCond ${REQUEST_URI} ^/.*/.*$
RewriteRule ^/?([^/]+)/(.*)$ /$1-$2 [N]

RewriteCond !{REQUEST_FILENAME} !-f
RewriteRule ^/?(.*)$ /$1.php [L]
Ignacio Vazquez-Abrams
When I went to `http://localhost/root_folder/test/hello/`, it got stuck in an infinite loop and Apache's memory usage jumped over 1.5 gb
Tim Cooper
Sorry about that, I forgot the check to see if there was actually a slash in the URI to change.
Ignacio Vazquez-Abrams