HELP .htaccess

kidcajes

New Member
Messages
21
Reaction score
0
Points
0
I am having problem, i was thinking that maybe it's the htaccess has the problem.

Situation:

if i type: http://??????.com/fetch.php, the part where the fetched data needs to be displayed is working fine but

if i type:http://www.??????.com/fetch.php the part where the fetched data needs to be displayed are cannot be seen.

I was hoping that maybe someone can help to solve this with .htaccess conditional statement


Thank you
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Please post the contents of the .htaccess file so that we can see what's going wrong.

It's probably just needs a "(www.)?" added in.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
What does the page do?

Where does the data come from?

Do you parse URLs anywhere in the script?
 

kidcajes

New Member
Messages
21
Reaction score
0
Points
0
this is what is inside the .htaccess

RewriteEngine On

RewriteRule ^(.*)/(.*).html$ cities_list.php?county=$1 [L]
RewriteRule ^(.*)-(.*).html$ final.php?city=$1&state=$2 [L]


php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
A simple workaround would be to strip the leading "www" using a redirect:
Code:
RewriteCond ${HTTP_HOST} ^www\.
RewriteRule ^/?(.*) http://example.com/$1 [R=301,L]

As for what's causing the problem, try typing in a URL that would be the final result of rewrites (eg http://www.example.com/final.php?city=New+York&state=NY ) and see what you get so you can check if it's the rewrite that's failing or something else. What's your real site? Not giving a real URL doesn't protect your site, it just makes it harder to help.
 
Top