dtdetu Posted June 18, 2009 Share Posted June 18, 2009 hello , i want to convert www.mysite.com/result.php?url=google.com to www.mysite.com/google.com please help me Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/ Share on other sites More sharing options...
trq Posted June 18, 2009 Share Posted June 18, 2009 RewriteRule ^/([a-zA-Z0-9]+)/$ result.php?url=$1 [L] Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-858814 Share on other sites More sharing options...
dtdetu Posted June 18, 2009 Author Share Posted June 18, 2009 hey thats not working , http://www.sitesmartcheck.com/google.com http://www.sitesmartcheck.com/result.php?urls=google.com i used RewriteRule ^/([a-zA-Z0-9]+)/$ result.php?urls=$1 [L] Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-859154 Share on other sites More sharing options...
dtdetu Posted June 18, 2009 Author Share Posted June 18, 2009 anyone? Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-859189 Share on other sites More sharing options...
ldougherty Posted June 18, 2009 Share Posted June 18, 2009 Try this.. Options +FollowSymlinks RewriteEngine on RewriteRule ^/([^/]+).com /result.php?section=$1 [NC] There is some real good information in http://corz.org/serv/tricks/htaccess2.php Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-859215 Share on other sites More sharing options...
dtdetu Posted June 18, 2009 Author Share Posted June 18, 2009 thanks but i will need other domain extentions too. also this code didnt work too RewriteEngine on RewriteRule ^/([^/]+).com /result.php?urls=$1 [NC] Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-859233 Share on other sites More sharing options...
ldougherty Posted June 18, 2009 Share Posted June 18, 2009 just remove the .com aspect then, the ([^/]+) states to include anything as $1 and then outputs it on the other side. Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-859234 Share on other sites More sharing options...
dtdetu Posted June 18, 2009 Author Share Posted June 18, 2009 i did but still not working Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-859239 Share on other sites More sharing options...
Ken2k7 Posted June 20, 2009 Share Posted June 20, 2009 Cheap one. I'm not going to write a regex to check if the argument is in valid url format. Options +FollowSymLinks RewriteEngine on RewriteRule ^/(.*)$ result.php?url=$1 [L] Link to comment https://forums.phpfreaks.com/topic/162745-help-about-rewrite/#findComment-860046 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.