.htaccess 500 error

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post October 4th, 2009, 11:03 am

Im useing this code on my site to get some nice urls its in my .htaccess file but I get a 500 error I think the code is okay ive checked it any thorghts?
APACHE Code: [ Select ]
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*). index.php?page=$1
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteRule (.*). index.php?page=$1
^__^
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 4th, 2009, 11:03 am

  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Feb 17, 2005
  • Posts: 1585
  • Status: Offline

Post October 4th, 2009, 11:49 am

Try this:
APACHE Code: [ Select ]
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([A-Za-z_0-9-]+)/?$ index.php?page=$1 [QSA,L]
 
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteRule ^([A-Za-z_0-9-]+)/?$ index.php?page=$1 [QSA,L]
  4.  


It rewrites anything alpha-numeric or dash/underscore, keeps the query string and stops matching rules after it, if it's the last one.

For more on the QSA & L flags: http://httpd.apache.org/docs/2.2/rewrit ... flags.html
There's no place like 127.0.0.1, badass part is now it's ::1
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post October 4th, 2009, 12:02 pm

no im still getting the error
^__^
  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Feb 17, 2005
  • Posts: 1585
  • Status: Offline

Post October 4th, 2009, 9:19 pm

Check if mod_rewrite is enabled on your server. Make sure your htaccess file has valid commands in it.
There's no place like 127.0.0.1, badass part is now it's ::1
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 5th, 2009, 8:40 am

If you're sure mod_rewrite is working, say you've already used it somewhere else on the site or you've wrapped the rewrites in an <IfModule> container and still get the error, you can look for the value of AllowOverride in either your virtual host container or Apache configuration file.

If that directive doesn't evaluate to allowing Options overrides in some way, it's a likely source of the error.

APACHE Code: [ Select ]
RewriteRule (.*).


That looks like it's going to cause an infinite loop, which would become an error, but that's likely not the problem since you've already tried PHs line there.
Strong with this one, the sudo is.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post October 6th, 2009, 1:01 am

I will have a look when I can friends got my laptop at mo with it all on - I was using the
Code: [ Select ]
RewriteRule (.*).
because I wanted to make it look like a proper URL and add a .html or .htm on the end! :lol:
^__^

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 181 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.