LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 03: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, 03:52 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
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, 04:12 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
This sounds like a job for mod_rewrite.
 
Old 08-02-2008, 02: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, 02: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, 02:51 AM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
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, 03: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, 03:05 AM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Then try the first AliasMatch i gave.
 
Old 08-02-2008, 03: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, 11:28 AM   #10
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:32 PM.

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
Open Source Consulting | Domain Registration