Deks Posted September 6, 2011 Share Posted September 6, 2011 Hello guys, i have problem trying to do rewrite url. Am new in this so i tried reading lots of forums, articles and nothing didn't help me. Url is : http://localhost/test2/test.php?id=1 (using xampp for testing) and i want to see only http://localhost/test2/id . I changed my .htaccess to : Options +FollowSymLinks RewriteEngine On RewriteRule ^test2/id$ /test2/test.php?id=1 [L] (code i generated with some online generator) Also i changed all necessary lines in \xampp\apache\conf\httpd.conf like : LoadModule rewrite_module modules/mod_rewrite.so AllowOverride All ...but like i told nothing happens. Hope someone will find out solution for my problems. Thx lot. Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/ Share on other sites More sharing options...
requinix Posted September 6, 2011 Share Posted September 6, 2011 Did you restart XAMPP after editing the httpd.conf? If you put random, invalid nonsense in your .htaccess and try the URL again do you get a 500 error? Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/#findComment-1266050 Share on other sites More sharing options...
Deks Posted September 6, 2011 Author Share Posted September 6, 2011 Yes i did restart xampp. And no there isn't any error. Page load without errors but link is like before. No changes, and i don't understand why wont change. Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/#findComment-1266117 Share on other sites More sharing options...
cags Posted September 7, 2011 Share Posted September 7, 2011 It sounds like you are expecting the links on your site to change, mod_rewrite won't do this for you. All it allows is for requests for one URI, to be mapped to a different URI based on a pattern / set of rules. Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/#findComment-1266310 Share on other sites More sharing options...
Deks Posted September 7, 2011 Author Share Posted September 7, 2011 Yes, true. I get everything same, like i never try change it. Dunno what to do to get some results. If someone have some experiance with this and have some advice for me it would be great. Thx guys. Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/#findComment-1266319 Share on other sites More sharing options...
Deks Posted September 7, 2011 Author Share Posted September 7, 2011 Ok, I did some reasearch and try to put some codes and i got error 500. Is that good thing in progress..any solutions come somebody on mind? Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/#findComment-1266338 Share on other sites More sharing options...
requinix Posted September 8, 2011 Share Posted September 8, 2011 I get everything same, like i never try change it. Dunno what to do to get some results. If someone have some experiance with this and have some advice for me it would be great. Like cags said, you have to change the links yourself. mod_rewrite won't do that for you. Quote Link to comment https://forums.phpfreaks.com/topic/246541-rewrite-doesnt-work/#findComment-1267039 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.