blueman378 Posted February 10, 2009 Share Posted February 10, 2009 ht access problems hi guys, heres what my .htaccess file looks like Options +FollowSymlinks RewriteEngine on RewriteRule ^test/([^/]+) /index.php?text=$1 [NC] my directory structure is -www directory --test ---index.php the index.php file contains: <?php echo $_GET['text']; ?> now what im wanting is if say i visit localhost/test/hello the php page wil display hello, but instead i get page not found, any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/144579-solved-htaccess-problems/ Share on other sites More sharing options...
gunabalans Posted February 10, 2009 Share Posted February 10, 2009 http://www.seochat.com/seo-tools/url-rewriting/ Quote Link to comment https://forums.phpfreaks.com/topic/144579-solved-htaccess-problems/#findComment-758720 Share on other sites More sharing options...
blueman378 Posted February 10, 2009 Author Share Posted February 10, 2009 tried using that, but it generates urls with the parameter in them. how close is my original attempt to what i want? Quote Link to comment https://forums.phpfreaks.com/topic/144579-solved-htaccess-problems/#findComment-758737 Share on other sites More sharing options...
gevans Posted February 10, 2009 Share Posted February 10, 2009 If everything's inside the directory /test try this... Options +FollowSymlinks RewriteEngine on RewriteBase /test/ RewriteRule ^([^/]+)$ index.php?text=$1 [NC] Or Options +FollowSymlinks RewriteEngine on RewriteRule ^test/([^/]+)$ test/index.php?text=$1 [NC] Quote Link to comment https://forums.phpfreaks.com/topic/144579-solved-htaccess-problems/#findComment-758809 Share on other sites More sharing options...
blueman378 Posted February 10, 2009 Author Share Posted February 10, 2009 cheers guys got it going with RewriteRule ^([0-9a-z]+)$ index.php?text=$1 [NC] the htaccess file is in my test directory so yeah it will only rewrite if your in the test directory. Quote Link to comment https://forums.phpfreaks.com/topic/144579-solved-htaccess-problems/#findComment-759177 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.