Help - Search - Members - Calendar
Full Version: .htaccess Problem
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > Other Languages
IamShipon1988
Well recently I've been working on a project to work on a site similar to myspace and facebook for my friends and community. I have all the items up but when I try to make my pages static (mysite.com/user_name) instead of dynamic (mysite.com/profile.php?id=user_name) I get an extra output of a value.

Basically instead of it being just mysite.com/user_name my htaccess is causing it to be mysite.com/user_name/$id

I'm really not sure why it's outputting that extra $id value, so I came here to seek help. Here is a copy my htaccess and a link to my project site is http://microdiary.org

CODE
RewriteEngine On
Options +Followsymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/images/(.*)$ /images/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/uploads_user/(.*)$ /uploads_user/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /profile.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([0-9]+)/?$ /blog_entry.php?user=$1&blogentry_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([^/]+)?$ /blog.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/?$ /blog.php?user=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/([0-9]+)/?$ /album_file.php?user=$1&album_id=$2&media_id=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/?$ /album.php?user=$1&album_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/([^/]+)?$ /album.php?user=$1&album_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/?$ /albums.php?user=$1 [L]
allstar
Are you sure? Just for kick's I signed up on MicroDiary and by viewing my profile offline/online, I get microdiary.org/allstar.

You can try a hard refresh (ctrl + F5).
IamShipon1988
Well I fixed up most of the errors. Now the error remains only at the profile pages album area.

So basically the problem is that when it's in static mode, it does not know how to get the albums id. I tried almost everything and now my head hurts. I could always remove that area, but I'd rather keep it on.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.