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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-17-2008, 09:49 PM
|
#1
|
LQ Newbie
Registered: Nov 2007
Posts: 4
Rep:
|
Rewriterule problems apache 2.2.4
Quote:
RewriteRule ^/t/([0-9]+)$ /test_push.php?test_push_id=$1
|
After I visit test.com/t/1, the page goto test.com/test_push.php?test_push_id=$1 ,but the RewriteRule can't do it,so please help
Last edited by qwqg; 03-18-2008 at 02:05 AM.
|
|
|
03-18-2008, 01:16 AM
|
#2
|
Member
Registered: Apr 2006
Posts: 63
Rep:
|
Hi
I compared your rule with my own rules and the only thing I noticed is the leading slash. You may try this:
Code:
RewriteRule ^t/([0-9]+)$ /test_push.php?test_push_id=$1
Norbert
|
|
|
03-18-2008, 01:44 AM
|
#3
|
LQ Newbie
Registered: Nov 2007
Posts: 4
Original Poster
Rep:
|
Quote:
Originally Posted by norbert74
Hi
I compared your rule with my own rules and the only thing I noticed is the leading slash. You may try this:
Code:
RewriteRule ^t/([0-9]+)$ /test_push.php?test_push_id=$1
Norbert
|
thank you!
I take out the leading slash,and test.com/t/1 display "HTTP 404 not found"
Can you paste your rewrite config file? Do you have other rule or RewriteCond?
|
|
|
03-19-2008, 11:50 AM
|
#4
|
Member
Registered: Apr 2006
Posts: 63
Rep:
|
Do you also get a 404 if you directly open /test_push.php?test_push_id=$1 ? If yes, then it's not your rule, if no then please look in the apache log what file the web server tries to access.
As far as I know there is no configuration file for mod_rewrite like for mod_ssl or other modules for example. I just put all my rules in a .htaccess file, that's all.
Here is an example:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#redirect domain.com to www.domain.com
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteRule ^t/([0-9]{1})$ /test_push.php?test_push_id=$1
</IfModule>
|
|
|
03-19-2008, 09:42 PM
|
#5
|
LQ Newbie
Registered: Nov 2007
Posts: 4
Original Poster
Rep:
|
thank you!
I can visit this page, http://www.test.com/w/4, but the links in it are all wrong, their url addresses all have /w, in fact the correct urls have no /w in addresses.
|
|
|
03-20-2008, 11:08 AM
|
#6
|
Member
Registered: Apr 2006
Posts: 63
Rep:
|
It is not clear for me what you mean actually. If you want help, than please describe in more detail, give examples and so on.
|
|
|
03-21-2008, 04:20 AM
|
#8
|
Member
Registered: Apr 2006
Posts: 63
Rep:
|
I personally still don't understand your scenario, maybe someone else does?
If you want contact me via ICQ (218595557) for direct communication.
|
|
|
All times are GMT -5. The time now is 05:06 AM.
|
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
|
|