com web/people: better rewrite for username short url: .htaccess
| From: | Peter Cowburn | Date: | Thu, 03 Oct 2013 13:37:27 +0000 |
| Subject: | com web/people: better rewrite for username short url: .htaccess | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-16769@lists.php.net to get a copy of this message | ||
Commit: 1b57979f5a66b45d0a7ec1b837c40bae2eab23e9
Author: Peter Cowburn <petercowburn@gmail.com> Thu, 3 Oct 2013 14:31:22 +0100
Parents: 703a5cbfba0f924c56ff85095f260368435909a0
Branches: master
Link: http://git.php.net/?p=web/people.git;a=commitdiff;h=1b57979f5a66b45d0a7ec1b837c40bae2eab23e9
Log:
better rewrite for username short url
TODO: fix HTML so short urls can have a trailing slash
Changed paths:
M .htaccess
Diff:
diff --git a/.htaccess b/.htaccess
index 939e99b..9fb12df 100644
--- a/.htaccess
+++ b/.htaccess
@@ -2,4 +2,4 @@ RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^(.*)$ http://%{HTTP_HOST}/user.php?username=$1
[L,QSA,R=302]
\ No newline at end of file
+RewriteRule ^([^/]+)/?$ /user.php?username=$1 [L,QSA]