php - .htaccess file not working at all -


i trying redirect when trying hit "192.168.21.3:8080/ping" "192.168.21.3:8080/ping.php" via creating .htaccess file following code in it:

//301 redirect old file redirect 301 http://192.168.1.234:8080/ping http://192.168.1.234:8080/ping.php 

also, following line in httpd.conf has been un-commentated:

loadmodule rewrite_module modules/mod_rewrite.so 

please help!

i still learning basics myself have try out, if let me know how on.. can re-edit answer should solution not work.

you can either redirect traffic page named ping.php or per question can redirect specific ip address ping.php.

add code below .htaccess file.

rewriteengine on rewritecond %{remote_addr} 192\.168\.21\.3 rewritecond %{request_uri} !/ping\.php$ rewriterule $ /ping.php[r=301,l] 

alternatively take here may out: https://perishablepress.com/permanently-redirect-a-specific-ip-request-for-a-single-page-via-htaccess/

thanks


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -