mojito Posted June 19, 2006 Share Posted June 19, 2006 here is some code in my .htaccess im trying to figure out...[code]RewriteBase /RewriteRule ^\.htaccess$ - [F]RewriteRule listing/(.+) /listing.php?type=$1RewriteRule faq/(.+).php /roatan-faq.php?catid=$1RewriteRule photo_album/(.+)/(.+) /spg_view_category.php?category_id=$1RewriteRule photo/(.+)-(.+)/(.+) /spg_view_image.php?image_id=$1&category_id=$2[/code]I cant work out how from my localhost machine where im testing this stuff it actually links to the real website so somehwhere the domain is getting changed from the root which should be localhost but is not.Is it the RewriteBase command ? I cant work out I just figured out that problem there was a <base> tag set in the source. Silly me.But here is my problem, I cant get it to work on my localhost. I cant debug it, i cant see what the rewritter is creating its not right as it cant find the page, how can i do an echo or print in .htaccess?Also how can I comment out lines in .htaccess I tried a # but it doesnt seem to work. [edit it does work now]thanksmojito [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] Quote Link to comment Share on other sites More sharing options...
mojito Posted June 19, 2006 Author Share Posted June 19, 2006 If I get a url like [a href=\"http://localhost/cambs.eu/listing/properties.php\" target=\"_blank\"]http://localhost/cambs.eu/listing/properties.php[/a]then the rule RewriteRule listing/(.+) /listing.php?type=$1should give /listings.php?type=properties.phpIt doesnt in fact the query string isnt working. What am I doing wrong. Even if i hard code something the query string isnt output.thanks for help on this.mojito Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted June 20, 2006 Share Posted June 20, 2006 you need to add a rule code to the end of each rewrite rule. like you have [F] on one of those. most times you can use [R] but that is redirect and not a rewrite. Go to the apache manual and look up rewrite rules to learn more about the different rules you cna use. Quote Link to comment 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.