Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.
  • Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

htaccess help >< please

Status
Not open for further replies.
Joined
Feb 10, 2006
Posts
321
Reaction score
24
Hi,

I know its late and im a bit tired, but this shouldn't be problem. I've got mind freeze.

I cant seem to get my .htaccess file right

Im trying to write

/fish[type].php

eg

/fishcarp.php

Code:
RewriteEngine On
RewriteRule ^fish([^/]*)\.html$ /fish-page.php?type=$1

this works

/fishcarp.html

but but not this

Code:
RewriteEngine On
RewriteRule ^fish([^/]*)\.php$ /fish-page.php?type=$1

for /fishcarp.php

I was thinking if it was a server i'm missing. Any ideas??
 
hi,

thats great.

do you know how I would make it work for more than one page?


I tried

Code:
RewriteRule ^fish([a-z]+).php$ fish.php?fish=$1 [NC, QSA] 
RewriteRule ^food([a-z]+).php$ food.php?fish=$1 [NC,QSA]
RewriteRule ^lifespan([a-z]+).php$ lifespan.php?fish=$1 [NC,L,QSA]

but its not working.

Any Ideas?
 
You need to intercept the variable in the above rewrites its going to $_GET["fish"] in php, so you need to make sure each script is accepting that.

Also you need 3 files fish.php/food.php/lifespan.php which are accepting the fish variable, there is no other reason it wouldn't work.
 
Yeah I've done this many times before and never had this problem though. Thanks for your help Skinner. I'm thinking something is different on the server I'm using. Going to test on another server later.

Thanks again.
 
I just added

RewriteRule ^fish([a-z]+).php$ fish.php?fish=$1 [NC,L,QSA]
RewriteRule ^pie([a-z]+).php$ pie.php?fish=$1 [NC,L,QSA]
RewriteRule ^recipe([a-z]+).php$ recipe.php?fish=$1 [NC,L,QSA]

and having just

<?php echo $_GET['fish']; ?>

in the 3 files, it works fine.

must be something server related.
 
Thanks skinner, that now works.

Think i'm cracking up.

I cant see the original problem, but just gald its sorted.

Thank you ver very much : )
 
Status
Not open for further replies.
Top Bottom