[Question] Using .htaccess to bypass certain pages?
This has been asked several times and I'm not sure if this will do it...
I've been googling .htaccess stuff and found an article on how to bypass or gain control over certain pages for things like wordpress which also uses virtual directories. http://striderweb.com/nerdaphernalia/20 ... -htaccess/
The virtual pages in vShare are, I believe, created by the .htaccess RewriteRule much in the same way. I want the page a person sees after they login to NOT be their profile page, but some other page, like the welcome page that they get when they click the link in the welcome email (invite_friends.tpl) OR the main page (anything other than their profile page).
:?: Would something like this be driven by .htaccess and how would one go about redirecting them with it? I think it has to do with this part of the .htaccess:
Code:
RewriteRule ^([^/\.]+)?/?$ user.php?username=$1 [L,QSA]
Re: [Question] Using .htacces to bypass certain pages?
OK, here's what I was able to dig up so far.
I commented out the RewriteRule for user.php and put in a different one:
Code:
#RewriteRule ^([^/\.]+)?/?$ user.php?username=$1 [L,QSA]
RewriteRule ^([^/\.]+)?/?$ invite_friends.php?welcome=$1 [L,QSA]
This works for when a person logs in, they go to the invite_friends welcome page, only problem is now they can not access their profile or anyone else's at all. The only way they can access their own profile is if they access the URL /my_profile.php . I think it has to do with conditions, but I don't know how to do it...yet.
During my search, I found a very cool page that generates .htaccess for you which I think is the neatest thing since sliced bread:
http://www.southeasttelephone.com/tools ... cessor.php
So, it's back to more digging unless there's an .htaccess guru out there who can help with this, I'd be ever so grateful (and I'm sure so would the rest of the vShare community).
Re: [Question] Using .htaccess to bypass certain pages?
Well, I figured out something else in the meantime. I wanted extra pages for my site which are in a subdirectory, but didn't want to have to type in "index.php" all the time. When I access the admin page, I noticed that we don't have to put in admin/index.php to go there, so I took a look at the .htaccess to find out why and this is what I found in it:
Code:
RewriteRule ^admin$ - [L]
RewriteRule ^admin/(.*) - [L]
Now that I have a subdirectory in my vshare, all I have to do is put
Code:
RewriteRule ^share$ - [L]
RewriteRule ^share/(.*) - [L]
and it goes to the share pages without having to put in "index.php" each time. :D Works GREAT for my "contact" page which is in a subdirectory called "contact".