Redirect question / htaccess?

wordpress

#1

Hi all,

I have an odd question, and wonder if anyone can help (Atropos?). Seems like the staff are having a pretty bad week, so I don’t really want to bother them with this right now.

I’m setting up a bunch of ftp users on my site with their own webspace. I initially just created a subfolder for each (http://members.malcs.net/ajuarez/) and then used Redirect SubDir to have that address draw from the individual ftp account. Should be simple. Only thing is, Redirect SubDir won’t let me redirect to a root user folder–has to be a sub (http://malcs.net/ajuarez/web/) which is a longer address than I’d like.

So my alternate choice was to create a secondary subdomain, http://ajuarez.members.malcs.net - which lets me indicate the ftp user as primary user. Thing is, the url is still too long, and it’s just awkward–particularly because the accounts are for newbies. SO, my question is, is there another way I can make or request a redirect so that this subdomain is displayed at http://members.malcs.net/ajuarez/ ? I know it’s not a big difference, but trust me, I know my users, and I would like to be able to give them this more standard format.

I’m stuck. Am I missing something? I guess what I want is to redirect to a folder, not a subdom. Or to make a subdom look like a folder for my newbie users. To make matters more difficult, I’m installing a Wordpress blog for each user, so I have to be careful about permissions.

Suggestions appreciated. Let me know if I can explain this better. Thanks,
s.


#2

I think you’re missing something. Everything I see in Remap Subdir says you can remap malcs.net/ajuarez as coming from /home/ajuarez/malcs. I did a quick test and came up with a screenshot of my setup:
http://www.scottdayman.com/remap.png

Another option would be to Fully Host subdomains, such as ajuarez.malcs.net owned by user ajuarez, so that it’s a pretty clean setup.

-Scott


#3

Yeah, you’re missing something, or else your a newb as well. Good thing about being a newb is that you’re not always going to be one!

As HTTP URLs go, the url-path is the part that goes after the hostname but before the query string or fragment identifier. It is shown in bold below.
http://hostname/path

As Scott demonstrates, you can map any url-path to a particular directory. However for each FTP user, you should make sure that you specify a subdirectory. For example if the home directory is /home/ajuarez, you should make a subdirectory called “public” or “web” and map the url-path to /home/ajuarez/public. Home directories are used to store various files and directories containing user information and should not be made web-accessible.

I am not sure I understand your question though, you are talking about two different things.

A redirect is where the web site tells the browser to fetch the content from a different URL. Since the browser has to fetch the content, the address the browser shows will change. The content can be on the same web site or a different web site.

A rewrite is where the web site changes the URL and then returns the content to the browser. The browser is not told what changes were made to the URL at all, and it does not have to make another fetch. Since the browser is not going to fetch a different URL, this will only work for that same website. You cannot have http://example.com/members/ re-written to http://members.example.com/ - since the hostname is different, it will be a redirect, and the visitor will see that http://members.example.com/ in the browser.

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#4

Hi Scott,

Thanks so much for your response. You had me for a minute there, but no go.

See my screenshots:
http://malcs.net/temp.htm

The difference seems to be that your path is rooted in pmbc, so I’m guessing “scott” is a primary user of the pmbc account? The only path options I’m given are /home/ajuarez rather than the primary malcs path of home/malcs/ (which would only give control of their account to me anyway).

In other words, if you establish a new ftp account, does it still work for you?

And yes, ajuarez.malcs.net is probably the easiest thing to do, but I worry that it will misrepresent members as official representatives rather than just members.

Argh. Thank you for your time,
s.


#5

Er, thanks Atropos, but I don’t think you read my question very carefully.

[/quote]

This is precisely my problem. I’m looking for a workaround that will let me skip the extra subdir, so that my newbs have a simpler address (/ajuarez instead of /ajuarez/web).

A redirect page isn’t feasible because we’re talking about multiple pages and multiple accounts.

[/quote]

I don’t think this is relevant.

I included your name, Atropos, because I saw a response you gave someone in a similar situation. and I wondered if a variant would work in mine.

Thanks,
s.


#6

Contact support. There’s no reason what you’re trying to do shouldn’t work.


If you want useful replies, ask smart questions.


#7

Scott’s not a user, it’s just an arbitrary person. User ‘pmbc’ owns that directory/domain.

Looking at your screenshot, it looks like some sort of circular mapping, where you’re trying to get a subdirectory to map to itself in the domain. If members.malcs.net is under /home/ajuarez, that’s not going to work.

Here’s a better example of a remapping:
http://www.scottdayman.com/remap2.png

What will (should) work is if user ‘malcs’ (or whomever, as long as it’s not ajuarez) has /home/malcs/members.malcs.net
You create another user ‘ajuarez’ and then as user ‘malcs’ do a remap so that members.malcs.net/ajuarez maps to /home/ajuarez/malcs

Now user ajuarez has ownership over their malcs directory which will show up as www.members.malcs.net/ajuarez

-Scott


#8

Hi Scott,

I’m not quite understanding what you’re saying.

[/quote]

malcs.net and members.malcs.net are under user “malcs” --that single primary account has root path home/malcs/

ajuarez is an ftp user with root /home/ajuarez. As a basic ftp account, she has no web access yet.

[/quote]

What do you mean “as user malcs”? That is the only way I can do anything at the control panel level, right?

[/quote]

I tried this once, and I’ll try it again, but from what I can see, this just created a subdirectory “malcs” on ajuarez’s ftp account. It didn’t connect to the primary malcs/ path (did you think it would?)

[/quote]

Why would it should up like that? It just shows up as http://members.malcs.net/ajuarez/malcs/ which works, but again, I was hoping to skip the subdir…

Am I misunderstanding you??? Thanks again for your time. I appreciate it.
s.
p.s. aren’t I supposed to be able to use html here?


#9

It looks like you did have it at one point:

[/quote]

It won’t connect. You won’t see an ‘ajuarez’ directory in /home/malcs/members.malcs.net/
The server should transparently make the connection when someone visits http://www.members.malcs.net/ajuarez

-Scott


#10

In the post that you mentioned I have this directive:

RedirectMatch /caravaggio$ http://caravaggio.baptism-of-blood.net/And this is what it does:

  1. Visitor types in http://baptism-of-blood.net/caravaggio
  2. Browser fetches http://baptism-of-blood.net/caravaggio
  3. Web site tells browser to visit http://caravaggio.baptism-of-blood.net/
  4. Browser fetches http://caravaggio.baptism-of-blood.net/

And naturally you can do the swap the URLs:

RedirectMatch /$ http://baptism-of-blood.net/caravaggio1. Visitor types in http://caravaggio.baptism-of-blood.net/
2. Browser fetches http://caravaggio.baptism-of-blood.net/
3. Web site tells browser to fetch http://baptism-of-blood.net/caravaggio
4. Browser fetches http://baptism-of-blood.net/caravaggio

For the first one directive, the .htaccess file would have to be in the /home/user/baptism-of-blood.net directory.

For the second directive, the .htaccess file would have to be in the
/home/user/caravaggio.baptism-of-blood.net directory.

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#11

Omigod. I just went back to my test page, and it works! I hadn’t waited long enough…
http://members.malcs.net/ajuarez/

I still don’t understand why though. Is the /malcs/ directory magic or what?

??
s.


#12

[/quote]

The server should transparently make the connection when someone visits http://www.members.malcs.net/ajuarez

So, yes, the '/malcs/ folder is the magic key? That’s what I was missing? The server puts that folder on the web? Is that true for all directories?

I’ve never been so happy to be confused. You’ve really helped me out here. Now the test is to install the wordpress to… / home/ajuarez/malcs/ , correct?


#13

[/quote]

Thanks for the clarification. It looks like it is an option for me at that end. I think I’ve got the problem figured out another way though. Still good for future ref.

Thank you for your time, A.


#14

I don’t use remapping, but it would appear that the only place to install Wordpress is in /home/ajuarez/malcs, and have it owned by user ajuarez.

The config may be a bit tricky/confusing since it’s a remapped directory. Just be careful when entering paths in the configuration. The Installation Confirmation e-mail may give you directions with all this figured out for you.

-Scott