homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Redirect rule for IP address 12.34.45.56/~username
bnivas




msg:4642009
 5:19 am on Feb 3, 2014 (gmt 0)

Hello,

I need a redirect rule redirect the following page in .htaccess


"http://12.34.45.56/~username" to "http://12.34.45.56/".

I am very new to this. Please help me.

On accessing "http://12.34.45.56/~username" it will redirect to "http://12.34.45.56/~username/verification.php".

So I need redirection like accessing "http://12.34.45.56/~username/verification.php" should go to "http://12.34.45.56/verification.php"

Please help me.

--
Nivas

 

lucy24




msg:4642018
 7:37 am on Feb 3, 2014 (gmt 0)

What have you tried so far?

:: insert Why We Make You Do It Yourself * boilerplate ::

On accessing "http://12.34.45.56/~username" it will redirect to

Do you mean that it currently does redirect to ... or that you want it to redirect to ...?

Also: is ~username one specific name, or do you want to capture and reuse a variety of names? Or recognize a variety of names and not capture them? (But if so, how will users be able to carry on where they left off after they've logged in?)


* This really exists. I wrote it up a couple of years ago. But it tends to make people mad. Um, madder than they were already.

bnivas




msg:4642026
 8:02 am on Feb 3, 2014 (gmt 0)

~username one specific name. No need to capture and reuse. But the URL after the username. ~username/xxx. There xxx should be captured and redirected to ip/xxx.

>>On accessing "http://12.34.45.56/~username" it will redirect to

Yes. It currently redirects. And it should also work fine.

lucy24




msg:4642028
 8:41 am on Feb 3, 2014 (gmt 0)

Now, wait. What URL after username? What's the pattern? Something was missing from the first post.

Anyway, original question stands. What have you tried so far, and what (exactly) happens when you try it?

bnivas




msg:4642032
 8:54 am on Feb 3, 2014 (gmt 0)

The pattern is "http://12.34.45.56/~username/verification.php". It should go to "http://12.34.45.56/verification.php".

I have googled for rules and tried something. Nothing works. I am a noob in this. Can you please tell what rules should I use?

Consider that nothing done. I got nothing in internet to redirect from the format "ip/~username".

lucy24




msg:4642132
 4:39 pm on Feb 3, 2014 (gmt 0)

and tried something. Nothing works.

If you won't say what you've tried, there's no way to know what went wrong.

:: detour to haul out boilerplate ::

Why We Make You Do It Yourself

There are plenty of forums where you can post a "how-to" question and get a fairly immediate answer. The answer may even be correct. But WebmasterWorld is about teaching you how to do it yourself. That way you can roll your own htaccess-- not just for today's problem but for tomorrow's almost identical one.

Here is the analogy:

Your child's room needs cleaning. You know that you can clean it yourself much faster and better than if you have to stand over your child and force him to do it right. But if you do the "make him get it right" part often enough, you will have raised a child who knows how to clean his room-- and who will some day stand glowering over his own children in the same circumstances.

Some day, someone else will post a question in the WebmasterWorld forums and you'll say "Hey, I know the answer to that one!"


I left out one paragraph which doesn't apply to you.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved