hope that got your attention Please help me : i want this url : 1. http://mysite.com/index.php?url=google.com 2. http://mysite.com/index.php?url=www.google.net i want to rewrite to : 1. http://mysite.com/google.com 2. http://mysite.com/www.google.net any suggestion on .htaccess?
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^([^.]+)$ index.php?url=$1 [L] Then check the rest of the site if there is anything...it probably won't work unless you have something unique in the URL, like a fake directory or extension.
thanks, but it wont work. some changes link : 1. http://mysite.com/tes/index.php?url=google.com i want to rewrite to : 1. http://mysite.com/tes/google.com
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !index\.php [NC] RewriteRule ^tes/(?:www\.)?([a-z0-9][a-z0-9\-]*[a-z0-9])\.([a-z]{2,4})$ tes/index.php?url=$1.$2 [L,NC]
nope still doesnt work. any other suggestion? ihave try this : RewriteRule ^(.*)\.(.*)$ index.php?url=$1.$2 [L] but still aint working, any others? and where should i put the .htaccess file? in the root or in the "tes/" folder
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !index\.php [NC] RewriteRule ^([a-z,0-9][a-z,0-9,\-]*[a-z,0-9])\.([a-z]{2,4})$ index.php?url=$1.$2 [L,NC] RewriteRule ^www\.([a-z,0-9][a-z,0-9,\-]*[a-z,0-9])\.([a-z]{2,4})$ index.php?url=www.$1.$2 [L,NC] Put it in the "tes/" folder. If you want it to work at the root just move everything there.
i still got some error. i cant run the script. this is form in "index.php: and when i click on submit button, nothing happens, what wrong? any solution?
Replace the old RewriteCond with this: RewriteCond %{REQUEST_URI} !\.php [NC] And use $_GET instead of $_POST: <form method="POST" action="results.php"> <input type="text" name="url" value="<?php echo ($_GET['url']) ? htmlspecialchars($_GET['url']) : 'http://xoogie.net'; ?>" size="40" /> <input type="submit" value="Submit" /> </form>