| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-01-2008, 03:28 PM
|
#1
|
|
LQ Newbie
Registered: Aug 2008
Posts: 9
Rep:
|
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
|
|
|
|
08-01-2008, 03:52 PM
|
#2
|
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
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.
|
|
|
|
08-01-2008, 04:12 PM
|
#3
|
|
Senior Member
Registered: Jun 2008
Posts: 2,529
Rep:
|
This sounds like a job for mod_rewrite.
|
|
|
|
08-02-2008, 02:41 AM
|
#4
|
|
LQ Newbie
Registered: Aug 2008
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by jiml8
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
|
|
|
|
08-02-2008, 02:48 AM
|
#5
|
|
LQ Newbie
Registered: Aug 2008
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by Mr. C.
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
|
|
|
|
08-02-2008, 02:51 AM
|
#6
|
|
Senior Member
Registered: Jun 2008
Posts: 2,529
Rep:
|
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
|
|
|
|
08-02-2008, 03:04 AM
|
#7
|
|
LQ Newbie
Registered: Aug 2008
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by Mr. C.
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
|
|
|
|
08-02-2008, 03:05 AM
|
#8
|
|
Senior Member
Registered: Jun 2008
Posts: 2,529
Rep:
|
Then try the first AliasMatch i gave.
|
|
|
|
08-02-2008, 03:35 AM
|
#9
|
|
LQ Newbie
Registered: Aug 2008
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by Mr. C.
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.
|
|
|
|
08-02-2008, 11:28 AM
|
#10
|
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
RewriteEngine on
RewriteCond %{REQUEST_URI} domain\.com
RewriteRule ^domain.com/(.*)$ index.php?mod=flyer&pg=list&act=property_view&details=det&propid=$1
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
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 |
All times are GMT -5. The time now is 06:34 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|