homepage Welcome to WebmasterWorld Guest from 54.227.34.0
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
how to redirect php page in httpd.conf file?
vasanth



 
Msg#: 4606499 posted 12:13 pm on Aug 31, 2013 (gmt 0)


RedirectMatch /(.*)/(.*)/(.*)/ [url][/url]http://123.123.123.123/myphp/redirect.php?t1=$1


when i pass the three parameters it will redirect to redirect.php.Actually this day fully i tried..I can't get it..Please help me..

<VirtualHost 123.123.123.123>
RedirectMatch /(.*)/(.*)/(.*)/ [url][/url]http://123.123.123.123/myphp/redirect.php?t1=$1
</VirtualHost>

Not working

 

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4606499 posted 9:20 pm on Aug 31, 2013 (gmt 0)

welcome to WebmasterWorld, vasanth!


how do you define "not working"?
what did your (exemplified) request look like and what was the response?

I assume the url forum tags are a typo.

do you have any RewriteRules in the .htaccess or httpd.conf?

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4606499 posted 11:10 pm on Aug 31, 2013 (gmt 0)

/(.*)/(.*)/(.*)/

:: peering into crystal ball ::

You mean
/([^/]+)/([^/]+)/([^/]+)/
That is: three nests of directory names.

t1=$1

Where did $2 and $3 go? If you're not going to reuse them you don't need to capture them.

See Forums Charter for explanation of example.com. (Or example dot anything if you need to name more than one domain.) Unlike other names it won't auto-link.

when i pass the three parameters it will redirect to redirect.php

Does "it will" mean "it's supposed to (but doesn't)"?

vasanth



 
Msg#: 4606499 posted 6:31 am on Sep 3, 2013 (gmt 0)

Sorry for late replay.Actually that three parameters not a directory.I assume some what different parameter values..It's like Query string.I need to pass arguments after I need to redirect to some other page..On the time these parameters i converted into Query string.


This is also i tried but not working

<VirtualHost 123.123.123.123>
ServerName example.com
SSLEngine on
SSLOptions +StrictRequire

DocumentRoot "/var/www/html/myphp"
Redirect /main/css/it https://123.123.123.123/myphp/redirect.php?t1=$1& t2=$2&t3=$3
<Directory />
SSLRequireSSL
</Directory>
</VirtualHost>

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4606499 posted 6:47 am on Sep 3, 2013 (gmt 0)

This is also i tried but not working

how do you define "not working"?
what did your (exemplified) request look like and what was the response?

do you have any RewriteRules in the .htaccess or httpd.conf?

t1=$1& t2=$2&t3=$3

these parameters will have no values unless you do something to capture those values in the Pattern.

<Directory />

this needs to be the full path to a directory.

vasanth



 
Msg#: 4606499 posted 6:57 am on Sep 3, 2013 (gmt 0)

Not working means this url i type in address bar

[123.123.123.123 ]

Then I press the enter button..It is not redirected to that particular website...sorry i am new to httpd.conf..I didn't do any RewriteRules..


when i pass three parameters that will redirect to that particular page..this output i need so basic things i need to do in httpd.conf...pls help me...thank u

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4606499 posted 7:49 am on Sep 3, 2013 (gmt 0)

http:/ /123.123.123.123/main/css/it

You're not getting the part about using example.com in posts, are you?

Does the redirect simply not take place at all, so you end up at the place you originally requested? What information do you get from LiveHeaders or equivalent? What do your logs (access and/or error) say?

Are you really restarting the server every time you change the rules? Seems like it would be simpler at this stage to AllowOverrides for some selected directory, and do all your experimenting in htaccess within that directory.

vasanth



 
Msg#: 4606499 posted 8:32 am on Sep 3, 2013 (gmt 0)

I doing my work in httpd.conf inside file...how to restart the server every time?

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4606499 posted 8:42 am on Sep 3, 2013 (gmt 0)

if you don't restart your server then any changes you make to httpd.conf will have no effect.
also, if you change any directives affecting redirect responses, then you will have to clear browser cache before testing these.

to restart the apache server, typically you would use apachectl:
http://httpd.apache.org/docs/current/programs/apachectl.html [httpd.apache.org]

where is your httpd.conf file located?

vasanth



 
Msg#: 4606499 posted 8:47 am on Sep 3, 2013 (gmt 0)

/etc/httpd/conf/httpd.conf this correct location or not.

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4606499 posted 8:56 am on Sep 3, 2013 (gmt 0)

Signal: TERM
apachectl -k stop

Sending the TERM or stop signal to the parent causes it to immediately attempt to kill off all of its children. It may take it several seconds to complete killing off its children. Then the parent itself exits.

I'm going to have nightmares about this.

vasanth



 
Msg#: 4606499 posted 9:11 am on Sep 3, 2013 (gmt 0)

Thank u very much..problem is restart..After restart working very nice..Thank you

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved