LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 08-01-2008, 04:28 PM   #1
eldojoseph
LQ Newbie
 
Registered: Aug 2008
Posts: 9

Rep: Reputation: 0
htaccess redirection


Hello All,

Thanks for all those who like to help me,,,,

am using web server running on Apache 2.2, I need to write an htaccess rule for redirection. I would like to call my domain with a sub folder mydomain.com/folder" this may a redirect to specific url, some thing like index.php?mod=flyer&pg=list&act=property_view&details=det&propid=folder. The folder name comes after the domain name varies. So finally my need is the mydomain.com/any folder name" may redirect to that specific page.

Thanks
 
Old 08-01-2008, 04:52 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
Be more specific, with a couple of examples of what you want.

What you gave gives no indication of where the flyer, list, property_view, or det information comes from.
 
Old 08-01-2008, 05:12 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
This sounds like a job for mod_rewrite.
 
Old 08-02-2008, 03:41 AM   #4
eldojoseph
LQ Newbie
 
Registered: Aug 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jiml8 View Post
Be more specific, with a couple of examples of what you want.

What you gave gives no indication of where the flyer, list, property_view, or det information comes from.

Examples

when i type domain.com/5
it should redirect to
index.php?mod=flyer&pg=list&act=property_view&details=det&propid=5

when i type domain.com/10
index.php?mod=flyer&pg=list&act=property_view&details=det&propid=10

I think u got it what my need is ?

Thanks
 
Old 08-02-2008, 03:48 AM   #5
eldojoseph
LQ Newbie
 
Registered: Aug 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mr. C. View Post
This sounds like a job for mod_rewrite.
Examples

when i type domain.com/5
it should redirect to
index.php?mod=flyer&pg=list&act=property_view&details=det&propid=5

when i type domain.com/10
index.php?mod=flyer&pg=list&act=property_view&details=det&propid=10

I think u got it what my need is ?

Thanks
 
Old 08-02-2008, 03:51 AM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Since you left of the protocol http://, it is not clear if "mydomain.com" is a path component, or part of the domain in the URI.

So which of these is correct?

Code:
http://domain.com/5
http://domain.com/domain.com/5
If it is the first:

AliasMatch ^/(\d+) index.php?mod=flyer&pg=list&act=property_view&details=det&propid=$1

otherwise:

AliasMatch ^/domain.com/(\d+) index.php?mod=flyer&pg=list&act=property_view&details=det&propid=$1
 
Old 08-02-2008, 04:04 AM   #7
eldojoseph
LQ Newbie
 
Registered: Aug 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mr. C. View Post
Since you left of the protocol http://, it is not clear if "mydomain.com" is a path component, or part of the domain in the URI.

So which of these is correct?

Code:
http://domain.com/5
http://domain.com/domain.com/5
If it is the first:

AliasMatch ^/(\d+) index.php?mod=flyer&pg=list&act=property_view&details=det&propid=$1

otherwise:

AliasMatch ^/domain.com/(\d+) index.php?mod=flyer&pg=list&act=property_view&details=det&propid=$1
Hi,

Thanks for reply I use http://domain.com/5 , but the folder doesn't exists it a value of id in the url, and also the digit comes after the domain name varies. some examples are when we type http://domain.com/5 the page need to be redirected to

index.php?mod=flyer&pg=list&act=property_view&details=det&propid=5

example 2:
when type http://domain.com/12 it should redirect to
index.php?mod=flyer&pg=list&act=property_view&details=det&propid=12
 
Old 08-02-2008, 04:05 AM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Then try the first AliasMatch i gave.
 
Old 08-02-2008, 04:35 AM   #9
eldojoseph
LQ Newbie
 
Registered: Aug 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mr. C. View Post
Then try the first AliasMatch i gave.
i have tried this and got this error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
 
Old 08-02-2008, 12:28 PM   #10
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
RewriteEngine on
RewriteCond %{REQUEST_URI} domain\.com
RewriteRule ^domain.com/(.*)$ index.php?mod=flyer&pg=list&act=property_view&details=det&propid=$1
 
  


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
redirection kkpal Programming 4 11-05-2007 11:24 PM
redirection rblampain Linux - Server 0 09-29-2007 01:39 AM
I/O redirection jittinan2 Linux - Newbie 7 08-21-2007 09:01 PM
redirection bhuvana Linux - General 2 07-03-2006 03:36 AM
redirection in C pantera Programming 2 08-11-2004 02:06 PM


All times are GMT -5. The time now is 04:12 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration