Log in

View Full Version : RewriteEngine



Princess$
08-01-2008, 11:33 PM
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^([-_!*$@~:.a-zA-Z0-9]+)$ http://mydomain.org/profile.php?username=$1

it says i need to » Add the code into your .htaccess file

but wont that cause errors if i open .htaccess in a document and add it?

there was a way in cpanel but i forgot.

Princess$
09-01-2008, 12:21 AM
I can not edit the post so i'll add the problem:

i install Joovili, and create a user account.

the website shows the new user and points to www.mydomain.org/princess/ (http://www.mydomain.org/princess/) or www.mydomain.org/wateva (http://www.mydomain.org/wateva)

i click the lnik and it takes you to page not displayed, i do not know if this is because of the rewrite needed but any help?

but profile.php?username=princess does?

if u have not got a clue how do i change it so that all profiles point to profile.php?username=$id

Moh
09-01-2008, 12:39 AM
The rewrite is needed to have a /username directory. The only problem is, it thinks register.php is a user :l

Princess$
09-01-2008, 12:53 AM
The rewrite is needed to have a /username directory. The only problem is, it thinks register.php is a user :l

How do i do the rewrite and make it work?

Awfy
09-01-2008, 01:47 AM
RewriteEngine on
RewriteRule ^$ index.php
RewriteRule (^[-_A-Za-z0-9\ ]*$) profile.php?username=$1 That should work, just add in the symbols you want usernames to allow into the brackets.

Princess$
09-01-2008, 07:53 AM
RewriteEngine on
RewriteRule ^$ index.php
RewriteRule (^[-_A-Za-z0-9\ ]*$) profile.php?username=$1 That should work, just add in the symbols you want usernames to allow into the brackets.

How do i write it into the system so it's done:|

Moh
09-01-2008, 08:04 AM
cPanel > File Manager (Click show hidden files) > public_html or www (Same place) then look for a file called ".htaccess" then add it in there :)

Awfy
09-01-2008, 09:08 AM
Open Dreamweaver or whatever you use to code. Copy and paste the copy input a blank page. Then save as ".htaccess" with no extensions and so on. Then upload to your site's directory.

abnormal
09-01-2008, 02:21 PM
either one of those would work, but i think Jack's idea would be much much easier. :)


cPanel > File Manager (Click show hidden files) > public_html or www (Same place) then look for a file called ".htaccess" then add it in there :)

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