The Little Guy Posted April 7, 2008 Share Posted April 7, 2008 Why doesn't this: http://gmm.phpsnips.com/random do a "Hidden" redirect to this: http://gmm.phpsnips.com/functions.php?function=random My .htaccess code: Options +FollowSymlinks RewriteEngine on RewriteRule ^/(.*)$ functions.php?function=$1 [nc] I want it to work like the php manual, where it takes you to rand if you type: http://php.net/rand it takes you to the rand function. if you follow my link, you will see what error I get: http://gmm.phpsnips.com/random Quote Link to comment Share on other sites More sharing options...
quickstopman Posted April 7, 2008 Share Posted April 7, 2008 The reason it doesn't work is because if you have an index you can't overlap it if you made it so the main page was function.php RewriteRule ^/ function.php?function=home so if make a function that made it so it includes the homepage this should work Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 7, 2008 Author Share Posted April 7, 2008 no... not what I want, random always changes. Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted April 7, 2008 Share Posted April 7, 2008 Please try: RewriteEngine on RewriteRule ^/([a-zA-Z]+)$ /functions.php?function=$1 Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 7, 2008 Author Share Posted April 7, 2008 Nope same problem Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 7, 2008 Author Share Posted April 7, 2008 I have tried this: RewriteRule ^(.*)$ /functions.php?function=$1 but it rewrites all pages to functions.php Quote Link to comment Share on other sites More sharing options...
quickstopman Posted April 8, 2008 Share Posted April 8, 2008 does your sub-directory your in, have an index if so erase that file first Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 8, 2008 Author Share Posted April 8, 2008 im not in a sub-directory, I am in the root directory Quote Link to comment Share on other sites More sharing options...
quickstopman Posted April 8, 2008 Share Posted April 8, 2008 then delete the index.html or default.html or what everfile type you use first! Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 8, 2008 Author Share Posted April 8, 2008 I don't think you quite understand what I am trying to accomplish here. The real URL: http://gmm.phpsnips.com/functions.php?function=choose The masked URL: http://gmm.phpsnips.com/choose both should go to the EXACT SAME FILE "functions.php" Quote Link to comment Share on other sites More sharing options...
mb81 Posted April 14, 2008 Share Posted April 14, 2008 I don't think you quite understand what I am trying to accomplish here. The real URL: http://gmm.phpsnips.com/functions.php?function=choose The masked URL: http://gmm.phpsnips.com/choose both should go to the EXACT SAME FILE "functions.php" Look at BillyBobs solution above, this should work, I do the same thing with our content management system, and I have this line: RewriteRule ^([a-z]+)$ content.php?id=$1 [L] Quote Link to comment 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.