Jump to content

Recommended Posts

here is some code in my .htaccess im trying to figure out...
[code]RewriteBase /
RewriteRule ^\.htaccess$ - [F]
RewriteRule listing/(.+) /listing.php?type=$1
RewriteRule faq/(.+).php /roatan-faq.php?catid=$1
RewriteRule photo_album/(.+)/(.+) /spg_view_category.php?category_id=$1
RewriteRule 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]

thanks
mojito [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /]
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=$1

should give

/listings.php?type=properties.php


It 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

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.