Here's my current .htaccess file:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ view_profile.php?member_id=$1
RewriteRule view_profile/(.*)/(.*)/$ /view_profile.php?$1=$2
The purpose of this is to allow users to get to member profiles by entering www.domain.com/usernamehere and they are forwarded, etc.
This works flawlessly except now I am trying to do all sorts of things to allow users to have widgets on their profiles on myspace. Unfortunately flash links, etc. won't work so I have given it a 3rd attempt and have created a dynamic image.
The coding works perfectly and the image is created perfectly but when I put the img src into myspace, myspace doesn't seem to like the fact that I am passing parameters in the img src. So as a work around, I was going to rewrite the URL but for some reason I can either use the above code which works with my social network, or the following code which works for the dynamic image rewritten URLS.
In other words, the code works for both individually but not when I put them together. When I try using them at the same time one or none will work.
I used the htaccess mod rewrite generator I found on:
http://www.webmaster-toolkit.com/mod_rewrite-rewriterule-generator.shtml
and again it works fine if I take out all the htaccess code above and stick in this code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule potsticker/(.*)/(.*)/$ /potsticker.php?$1=$2
One more time I'll say it, the above code works fine on its own to do its job, and the code at the top I mentioned also works fine when used on its own. When I try to put them in the same time one or none will work, no matter what I've tried.
Here is the code that I tried which includes both code for the profiles to work and code for the dynamic image to be redirected.
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ view_profile.php?member_id=$1
RewriteRule view_profile/(.*)/(.*)/$ /view_profile.php?$1=$2
Options +FollowSymLinks
RewriteEngine on
RewriteRule potsticker/(.*)/(.*)/$ /potsticker.php?$1=$2
I've tried many variations to include removing the 2nd rewriteengine on and of course rearranging items. I have yet to figure out a way to allow me to get to where I want to get.
The rewrite for profiles should basically gather the number and forward the user to the profile. In other words something like this: domain.com/145 should in fact bring me to domain.com/view_profile.php?member_id=145 which does work fine.
The dynamic image should take an url like domain.com/potsticker/member_id/145/ and send the user to domain.com/potsticker.php?member_id=145
Each code works but not when I have both codes in the same htaccess file. Any help would be absolutely appreciated!