Jump to content

.htaccess on a subdomain + php


blazing

Recommended Posts

Hi, I am having a problem with my .htaccess on my subdomain.

 

Here is my code in the .htaccess

 

RewriteEngine on
RewriteRule ^(.*) /home/user/public_html/profile/profile.php?user=$1
RewriteRule ^(.*)/ /home/user/public_html/profile/profile.php?user=$1

 

Ok, so this code works for stuff in folders like mysite.com/(real folder)forum/(script)"topic/1", on a subdomain or not, but it wont work in the main folder if that makes any sense.

 

So, I have this.

my subdomain is profile.mysite.com

 

People view this profile.mysite.com/1 or profile.mysite.com/user/username

 

what happens is, I need the wildcard, and I use in my php script explode to break apart any / so I can make 2 differant variables, also anything more users add like user/username/lol/test/132123123123/123123123, does nothing and shows no error instead if I was to use $1 $2

 

ok, so I hope that much makes sense, but the problem is on my subdomain, when I go to echo the user=$1, all that comes up is profile.php instead of what people write .com/here/1/1/1/1/1/1

 

Any ideas of why im only running into this problem on my subdomain, and why its priting the scripts name?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/39114-htaccess-on-a-subdomain-php/
Share on other sites

What's the problem, restate the question, well thought.

 

Uhm, I just want to know why when I echo $user it prints "profile.php", instead of the variable in I guess what you can call the query string of profile.mysite.com/"1/", which should be "1/", profile.mysite.com/"user/blazing" being "user/blazing" (I use the explode next to split the / instead of adding extra $2 in .htaccess which create problems for me.

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.