Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!
Moderator: General Moderators
-
pickle
- Briney Mod
- Posts: 6445
- Joined: Mon Jan 19, 2004 6:11 pm
- Location: 53.01N x 112.48W
-
Contact:
Post
by pickle »
Moved to web servers forum.
This is a rewrite rule in an htaccess file that is supposed to take care of a lack of trailing slashes. I didn't write it, but I know it works.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
influx
- Forum Commoner
- Posts: 31
- Joined: Fri Aug 05, 2005 9:28 am
Post
by influx »
Hey all,
I tried changing it to the following:
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z_0-9-]+)((/)|())?$ redirect.php?user=$1
I even tried adding a
/ in front of redirect.php to call for the home directory.
None of this seems to work for me. If i type in
http://www.website.com/username/ it will still redirect to
http://www.website.com/username/redirec ... r=username.
What could be wrong? Could it be my server?
Thanks guys!
-
phice
- Moderator
- Posts: 1416
- Joined: Sat Apr 20, 2002 3:14 pm
- Location: Dallas, TX
-
Contact:
Post
by phice »
Code: Select all
RewriteEngine On
RewriteRule ^([a-z0-9_\-]+)(/)?$ redirect.php?user=$1
-
phice
- Moderator
- Posts: 1416
- Joined: Sat Apr 20, 2002 3:14 pm
- Location: Dallas, TX
-
Contact:
Post
by phice »
If this worked for you, please post a reply saying it did so we can label this threat as [SOLVED] to help others.