rewrite problem

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
DW
Forum Members
Forum Members
Posts: 15
Joined: Thu Dec 06, 2007 2:42 pm

rewrite problem

Post by DW »

Hi,

I'm running CMSMS 1.4.1

and I'm having a maybe silly problem.. I setup mod rewrite to run on the site and use .html as suffix for my pages. however, the pages work without the .html suffix, causing google to be somewhat annoyed at my site since I get duplicate content.. any help availible for this?
i.e. I get domain.com/about and domain.com/about.html... I would like to block the one without .html.

I solved this problem like this if anyone is interessted.
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}.html [R=301,L]

however, I got another problem now..
I try to do a 301 redirect from a old page to a new one,
I try to redirect /old to new.html by using this
redirect 301 /old http://www.domain.com/new.html

it does redirect the /old to /new.html but adds the page=old to the url making the page not showing.. any ideas?
Last edited by DW on Tue Jan 27, 2009 4:51 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: rewrite problem

Post by Dr.CSS »

I wish people would realize you don't run into duplicate content problems with goggle, unless you have more than one page with the same name and with cmsms it is impossible because the page alias will not let you use the same alias...

But as far as google finding dup. con. on your site because "you" can call the page all kinds of ways, with .html, w/o it or some kind of combo. of parent pages that don't exist or whatever way you try and test your site for dup. con....

IT DOESN'T MATTER TO GOOGLE...

Google is not going to make up page links for your site like you may do, it will read the links on the site and follow them and index the URL and content...

NOT TRY OUT ALL KINDS OF ESOTERIC URLs, IT ONLY READS THE LINKS ON YOUR SITE...

Now please once and for all quit acting like your going to get punished for dup. con. on your site because you can get to a page with some strange url you make up... only you are going to make them up NOT google or any other search engine...
DW
Forum Members
Forum Members
Posts: 15
Joined: Thu Dec 06, 2007 2:42 pm

Re: rewrite problem

Post by DW »

mark wrote: I wish people would realize you don't run into duplicate content problems with goggle, unless you have more than one page with the same name and with cmsms it is impossible because the page alias will not let you use the same alias...

But as far as google finding dup. con. on your site because "you" can call the page all kinds of ways, with .html, w/o it or some kind of combo. of parent pages that don't exist or whatever way you try and test your site for dup. con....

IT DOESN'T MATTER TO GOOGLE...

Google is not going to make up page links for your site like you may do, it will read the links on the site and follow them and index the URL and content...

NOT TRY OUT ALL KINDS OF ESOTERIC URLs, IT ONLY READS THE LINKS ON YOUR SITE...

Now please once and for all quit acting like your going to get punished for dup. con. on your site because you can get to a page with some strange url you make up... only you are going to make them up NOT google or any other search engine...

thanks for the information.. too bad that google have indexed pages without .html ending then due to some users linking to my site from various forums without the .html ending.. something I DON'T WANT!
why is everyone on this forum such a dick? noone is helpfull like on other open source solutions.. all answers to questions is just "read the manual" like it's the most easy thing to find stuff in, or telling people how they think it should be like their solution is the right answer for everyone.
I ended up having to manually enter ALL addresses in htaccess file to redirect to .html ending to get the result I wanted.. one thing for sure.. I will switch CMS system in the future since the help you get on this forum is shit, I rather pay for a CMS and get support than rely on getting help here when I get stuck..
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: rewrite problem

Post by Dr.CSS »

Hmm I don't believe in all the over 6000 post I've made have i ever told anyone to RTFM...

Nope I checked and never did, your rewrite problem has nothing to do with CMS Made Simple it has to do with your site being linked by ppl. in forums, (other than here?)...

There is a site dedicated to rewrite rules...

Google for it ;)...
DW
Forum Members
Forum Members
Posts: 15
Joined: Thu Dec 06, 2007 2:42 pm

Re: rewrite problem

Post by DW »

acctually the problem is with CMSMS because the rewrite rules that are included allow both .html and just entering /
this should be easy enough to fix by people who are skilled in these kinds of things and this kind of problem wouldn't be possible.

well.. I did google htaccess rewrite rules and I solved the problem, but it's kind of bothersome to have to manually create a rewrite rule for all pages I create.
brippon
Forum Members
Forum Members
Posts: 18
Joined: Wed Feb 07, 2007 10:28 pm

Re: rewrite problem

Post by brippon »

DW wrote:
I solved this problem like this if anyone is interessted.
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}.html [R=301,L]

however, I got another problem now..
I try to do a 301 redirect from a old page to a new one,
I try to redirect /old to new.html by using this
redirect 301 /old http://www.domain.com/new.html

it does redirect the /old to /new.html but adds the page=old to the url making the page not showing.. any ideas?
Hi DW

I don't know how you solved your problems in the end, but having just looked at a similar problem, I'll comment. One potential problem you had with the above was mixing RewriteRules and Redirects. AFAIK these are handled by different modules, mod_rewrite and mod_alias respectively. The order in which the rules are executed will be determined by the Apache setup, not your .htaccess, and the different rules will either interact or not (?) in indeterminate and unhelpful ways. Given that the standard CMSMS SEO htaccess uses mod_rewrite, I'd use RewriteRules for everything.

Cheers
Brian
Post Reply

Return to “CMSMS Core”