gongpex Posted March 15, 2014 Share Posted March 15, 2014 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 More sharing options...
justsomeguy Posted March 17, 2014 Share Posted March 17, 2014 URL rewriting does not change the URL you see in the browser, it tells the web server to use a different file to handle a given URL. Link to comment Share on other sites More sharing options...
gongpex Posted March 21, 2014 Author Share Posted March 21, 2014 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 More sharing options...
thescientist Posted March 21, 2014 Share Posted March 21, 2014 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 More sharing options...
gongpex Posted March 23, 2014 Author Share Posted March 23, 2014 No, I want just to test URL rewrite, I want to : from : localhost/index.php become localhost/index and localhost/?p=example become localhost/example please help thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now