This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-08-08 13:11:17

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

.htaccess

how would I change something like this:
http://eternityinc-official.com/profile.php?username=XenoK

into something like this:

http://eternityinc-official.com/users/XenoK


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#2 2012-08-08 15:24:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: .htaccess

Code:

RewriteEngine on
RewriteRule ^users/([a-zA-Z0-9_-]+)$ profile.php?username=$1

Offline

 

#3 2012-08-08 15:25:02

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: .htaccess

You need a good knowledge of RewriteRule and Regular Expressions.

Do something like this:

Code:

RewriteEngine On #turn on the Rewrite Engine, enabling RewriteRules
RewriteBase / #be sure to reset the base, otherwise it won't work!
RewriteRule ^users/(.*?)/?$ profile.php?username=$1

http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#4 2012-08-08 22:42:58

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: .htaccess

Ah, RewriteRules. Google is your friend in this.  tongue


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

Board footer