| Author |
Message |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Mon Mar 10, 2008 4:40 am |
|
I have problems with avatars with spaces in the name like Charlie Brown.gif
The RewriteRule is:
RewriteRule ^account-avatarsave-([a-z]*)-([\.a-zA-Z0-9_-]*).html modules.php?name=Your_Account&op=avatarsave&category=$1&avatar=$2 [L]
If I change to spaces like this:
RewriteRule ^account-avatarsave-([a-z]*)-([\.a-zA-Z0-9_- ]*).html modules.php?name=Your_Account&op=avatarsave&category=$1&avatar=$2 [L]
I get errors and this alternative can't be used. Grateful for suggestions! |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 867
|
Posted:
Mon Mar 10, 2008 7:46 am |
|
Would you please expound upon what you mean exactly by "I get errors"? Thanks. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Mon Mar 10, 2008 9:10 am |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 867
|
Posted:
Mon Mar 10, 2008 5:03 pm |
|
Ok, we are kind of having to design/code/test on the fly. What I am thinking is that we might have to break this up differently. With both the GT file and .htaccess, try something along these lines instead:
RewriteRule ^account-avatarsave-([a-z]*)-([\.a-zA-Z0-9%_- ]*).html modules.php?name=Your_Account&op=avatarsave&category=$1&avatar=$2 [L]
It looks like phpBB is encoding the space or maybe that is browser/Apache based... I added the "%" into the mix to see what happens. The odd thing is that the period is escaped like this "\." which should also take into consideration the file extension. But, one thing at a time. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Mon Mar 10, 2008 5:17 pm |
|
This gave server errors, because of the blank space in
[\.a-zA-Z0-9%_- ] and without the blank space, it did not give the correct result. |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 867
|
Posted:
Mon Mar 10, 2008 9:02 pm |
|
Hhmmm... sorry, try the blank space in the GT file, but then with the .htaccess rule escape it like this:
[\.a-zA-Z0-9%_-\ ] |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Tue Mar 11, 2008 12:06 am |
|
I tried that, but the \ gave server error in .htaccess, unfortunately, but blank space in GT file did not give that. |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 867
|
Posted:
Tue Mar 11, 2008 9:17 am |
|
I don't understand why the difference. The escaped space works just fine for me.
Moral of the story? Don't use spaces! LOL.
Ok, just kidding. Will have to continue to dig into it... |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Tue Mar 11, 2008 3:04 pm |
|
This seems to work on the test server [.a-zA-Z0-9+=\ ] but I have to test it tomorrow night on my site, when people are sleeping. |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 867
|
Posted:
Tue Mar 11, 2008 11:15 pm |
|
Ok, I don't think that will work either on your production system as it wouldn't capture the %20? I guess we'll see. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Wed Mar 12, 2008 1:38 am |
|
I have just tested it and it worked on the site, but I have modified a little to capture - [-.a-zA-Z0-9_+=\ ]. Many thanks for your help! |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 867
|
Posted:
Wed Mar 12, 2008 6:49 am |
|
Thanks! I will make this thread a Sticky. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
|
|