Jump to content

url rewrite configure


gongpex

Recommended Posts

Hello everyone,

 

today I test to use url rewrite on .htaccess file after installation php and all of web need,

 

I try using simple url rewrite like :

RewriteEngine OnRewriteRule ^test.php  test2.php [NC]

then I open my browser and type : localhost/test.php.

 

this link is open but didn't rewrite to localhost/test2.php

 

Q : Is there some mistake/lack configuration on http.conf at apache? or this code rewrite that wrong?

 

please help

 

thanks

 

 

Link to comment
Share on other sites

hello,

 

yes you right, if user open test.php this will change to test2.php,

 

but when I tried this on local server (localhost/test.php) this won't work, and the result still same only open test.php not open test2.php,

 

I use this just to try if "RewriteEngine " work or not.

 

Q : Is there something wrong on my http.conf?

 

please help

 

Thanks

Link to comment
Share on other sites

maybe you want a redirect instead? Like JSG, you can't rewrite the URL. You can take a vanity URL and map that to an actual file though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...