PDA

View Full Version : help?



DuxRawr
25-07-2008, 09:57 PM
In a website u get the page file such as, members.php?user=Moocow

Is there anyway u can get, yourweb.co.uk/members/moocow?

Can anyone help :)

Moved by Invent (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks :).

wsg14
25-07-2008, 10:01 PM
Edit your .htacces and add this under any code that's there:



RewriteEngine on
RewriteRule ^members/([^/]+)/?$ /members.php?user=$1 [L]

Excellent
25-07-2008, 10:02 PM
Thats a rewrite, check this link for the one you want:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

DuxRawr
25-07-2008, 10:04 PM
Edit your .htacces and add this under any code that's there:



RewriteEngine on
RewriteRule ^members/([^/]+)/?$ /members.php?user=$1 [L]


Could u explain that in abit more depth

wsg14
25-07-2008, 10:10 PM
Could u explain that in abit more depth

Explain what the code does or explain the .htaccess file?

DuxRawr
25-07-2008, 10:30 PM
bothh please :)

wsg14
25-07-2008, 10:39 PM
Read the comments.



RewriteEngine on // This turns on the rewrite engine, allowing us to make a rewrite rule.
RewriteRule ^members/([^/]+)/?$ /members.php?user=$1 [L] // This just turns members.php?user=x into members/x. I'd explain more if I wasn't on my iPod and knew more about it.

Source
25-07-2008, 10:46 PM
RewriteEngine on
RewriteRule ^members/([A-Za-z0-9-]+)/?$ members.php?user=$1 [L]


That's better code than box's. That doesn't allow special characters if I'm correct.

I would love to explain the depth of the rewrite module but the truth is google can do a hell of alot better.

DuxRawr
26-07-2008, 07:58 AM
Read the comments.



RewriteEngine on // This turns on the rewrite engine, allowing us to make a rewrite rule.
RewriteRule ^members/([^/]+)/?$ /members.php?user=$1 [L] // This just turns members.php?user=x into members/x. I'd explain more if I wasn't on my iPod and knew more about it.


Muchh Help +REP :D

Thanks so much

Jahova
26-07-2008, 08:20 AM
.htaccess is a wonderful thing!
http://httpd.apache.org/docs/1.3/howto/htaccess.html
http://www.htpasswdgenerator.com/apache/htaccess.html

DuxRawr
26-07-2008, 08:44 AM
.htaccess is a wonderful thing!
http://httpd.apache.org/docs/1.3/howto/htaccess.html
http://www.htpasswdgenerator.com/apache/htaccess.html


thanks for the help :)

Want to hide these adverts? Register an account for free!