Jump to content

What Is Wrong With My .htaccess File


Jamesking56
 Share

Recommended Posts

What is wrong with my .htaccess file below? it produces an error 500?

Options +FollowSymlinksRewriteEngine onRewriteCond %{http_host} ^pasteme\.uk.to [NC]RewriteRule ^(.*)$ [url="http://www.pasteme.uk.to/$1"]http://www.pasteme.uk.to/$1[/url] [R=301,NC]RewriteRule ^([a-zA-Z0-9_-]+)$ show.php?id=$1RewriteRule ^([a-zA-Z0-9_-]+)/$ show.php?id=$1RewriteRule ^action/([a-zA-Z0-9_-]+)$ action.php?do=$1RewriteRule ^action/([a-zA-Z0-9_-]+)/$ action.php?do=$1

Link to comment
Share on other sites

I thought your RewriteRules that aren't redirects had to be separated by a / :RewriteRule ^([a-zA-Z0-9_-]+)$ /show.php?id=$1RewriteRule ^([a-zA-Z0-9_-]+)/$ /show.php?id=$1RewriteRule ^action/([a-zA-Z0-9_-]+)$ /action.php?do=$1RewriteRule ^action/([a-zA-Z0-9_-]+)/$ /action.php?do=$1However, you also need to allow the for http://blah bit with .* ://like this for the last twoRewriteRule ^(.*)action/([a-zA-Z0-9_-]+)$ /$1action.php?do=$2RewriteRule ^(.*)action/([a-zA-Z0-9_-]+)/$ /$1action.php?do=$2//these first ones are funny, because you are capturing everything, including the http, and throwing it out as the id= variableRewriteRule ^([a-zA-Z0-9_-]+)$ /show.php?id=$1RewriteRule ^([a-zA-Z0-9_-]+)/$ /show.php?id=$1//maybe like this:RewriteRule ^(.*)/([a-zA-Z0-9_-]+)$ /$1/show.php?id=$2RewriteRule ^(.*)/([a-zA-Z0-9_-]+)/$ /$1/show.php?id=$2

Edited by chibineku
Link to comment
Share on other sites

RewriteRule ^(.*)/(.*)$ /$1/show.php?id=$2 [L]RewriteRule ^(.*)action/(.*)$ /$1action.php?do=$2 [L]Try those

Link to comment
Share on other sites

Let's see the new file in its entirety?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...