LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2013, 10:54 PM   #1
Ranjith KR
LQ Newbie
 
Registered: Sep 2012
Posts: 7

Rep: Reputation: Disabled
Nginx 301 rewrite rule


Hi,

I need to write an nging 301 rewrite rule that redirect,

http://test.domain.com


to

http://www.domain.com/somethng/

only.

jst this home page only, nothing else like http://test.domain.com/?abcd=546asda should not redirect,

Any help?

Thanks in advance.
 
Old 03-25-2013, 05:02 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,518

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi,

You may try this:
Code:
rewrite  ^/$ http://www.domain.com/somethng/ permanent;
rewrite  ^/index.html$ http://www.domain.com/somethng/ permanent;
Regards
 
Old 03-25-2013, 09:32 AM   #3
Ranjith KR
LQ Newbie
 
Registered: Sep 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi bathory,

Thanks for your quick reply.

I tried these steps however it does not fix my issue due to some custom redirect settings I think.
But i fixed the issue.

Thank you so much.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx rewrite rule for url like www.domain.com/something.php?asd=327154723448 Ranjith KR Linux - Server 2 03-10-2013 10:38 PM
nginx rewrite url ubungu Linux - Newbie 1 07-19-2012 08:51 AM
nginx rewrite mad_penguin Linux - Newbie 0 02-25-2012 01:53 AM
nginx rewrite / redirect LMW Linux - Server 4 05-14-2011 12:37 PM
htaccess 301 rewrite BillKat Linux - Server 2 04-07-2009 01:54 PM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration