canadian_angel Posted July 19, 2010 Share Posted July 19, 2010 Hi, I am new to php and have to do a project that consists of a joke page, a jokelist page and the front page or index page. My problem is this: I have used the text below in my .htaccess page and the only thing I get when I run the index.php file is the list of joke categories which is right but when i click on a category it produces an not found error. I am so confused, please can someone help! RewriteEngine On RewriteRule^/jokespage$ index.php Quote Link to comment https://forums.phpfreaks.com/topic/208233-mod_rewrite-cant-figure-this-out/ Share on other sites More sharing options...
cags Posted July 20, 2010 Share Posted July 20, 2010 The code you have pasted will make Apache look for any URLs that matches /jokespage. I do not believe that the forward slash is passed to a .htaccess file though so it will never match anything. On the flip side, you will likely need the forward slash on the rewritten address. Fixing that would give you... RewriteEngine On RewriteRule^jokespage$ /index.php This would take any request for http://yourdomain.com/jokespage, and would display http://yourdomain.com/index.php to the user. Quote Link to comment https://forums.phpfreaks.com/topic/208233-mod_rewrite-cant-figure-this-out/#findComment-1088479 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.