[htaccess] Redirects.. but doesn't do what I want [FIXED]
Edit: FIXED!
Hey, I have a .htaccess file in the root directory of my website.
It's job is to grab the request: http://www.avsbest.com/Spence.html
and display the data from:
http://www.avsbest.com/profile/profi...sername=Spence
What it does:
When I click a link to http://www.avsbest.com/Spence.html, it just redirects to http://www.avsbest.com/profile/profi...sername=Spence
, and shows the whole URL in the address bar instead of the smaller, easier one I want to display.
Here's the code: (this will help other ppl too I think)
Code:
AddType x-mapp-php4 .html .htm
# Example for a rewrite rule:
# (turns http://domain.com/xyz.html into http://domain.com/profile/profile.php?xyz)
#
#Options +Indexes
RewriteEngine on
RewriteBase /
RewriteRule ^([a-zA-Z0-9-]+)\.html$ profile/profile.php?username=$1 [R,L]
Is that what it's supposed to do? Because I've been to other sites where it actually displays the requested URL.. (example: avsbest.com/Spence.html)
Maybe go there and see that it's kind of wacky :scratch:
Re: [htaccess] Redirects.. but doesn't do what I want
Maybe just:
RewriteEngine on
RewriteRule ^/([a-zA-Z0-9-]+).html$ /profile/profile.php?username=$1
Re: [htaccess] Redirects.. but doesn't do what I want
Quote:
Originally Posted by
EliteGM
Maybe just:
RewriteEngine on
RewriteRule ^/([a-zA-Z0-9-]+).html$ /profile/profile.php?username=$1
Lol... Well I tried that and it couldn't find the page.. The wierd part is, when I changed it back to what I had, it works now.. strange..
Thanks man, that really helped! :drinks_no
[FIXED!]
Re: [htaccess] Redirects.. but doesn't do what I want [FIXED]
Hmmm...In EliteGM example there is no dot escaped, but dot is a special symbol. Strange.
Re: [htaccess] Redirects.. but doesn't do what I want [FIXED]
Oh shizzlw forgot that :p