.htaccess 500 error

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1585

Post 3+ Months Ago

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
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

no im still getting the error
  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1585

Post 3+ Months Ago

Check if mod_rewrite is enabled on your server. Make sure your htaccess file has valid commands in it.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

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.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

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: Bigwebmaster and 94 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.