Jamesking56 Posted September 24, 2009 Share Posted September 24, 2009 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 More sharing options...
chibineku Posted September 24, 2009 Share Posted September 24, 2009 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 Link to comment Share on other sites More sharing options...
Jamesking56 Posted September 24, 2009 Author Share Posted September 24, 2009 Basically, What I am trying to do is:turn my site urls different like:show.php?id=WHATEVER = http://mysite.com/WHATEVERaction.php?do=WHATEVER = http://mysite.com/action/WHATEVERHow can I do this? Link to comment Share on other sites More sharing options...
chibineku Posted September 24, 2009 Share Posted September 24, 2009 RewriteRule ^(.*)/(.*)$ /$1/show.php?id=$2 [L]RewriteRule ^(.*)action/(.*)$ /$1action.php?do=$2 [L]Try those Link to comment Share on other sites More sharing options...
Jamesking56 Posted September 28, 2009 Author Share Posted September 28, 2009 It still says 500 error...EDIT: See Newer Post Link to comment Share on other sites More sharing options...
chibineku Posted September 28, 2009 Share Posted September 28, 2009 Let's see the new file in its entirety? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 28, 2009 Share Posted September 28, 2009 Are you sure the htaccess file is the cause of the 500 response? Link to comment Share on other sites More sharing options...
Jamesking56 Posted September 28, 2009 Author Share Posted September 28, 2009 Oh wait, its working but I have yet to test it fully Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.