[Resolved] mod_rewrite issue

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
FireNetStudios
New Member
New Member
Posts: 5
Joined: Tue May 26, 2009 7:11 pm

[Resolved] mod_rewrite issue

Post by FireNetStudios »

So, I'm having a mod_rewrite issue.

I started with the code provided by the CMS MS documentation.

---------------------------------------------------
Options -Indexes
ServerSignature Off

Options +FollowSymLinks


RewriteEngine on

#Sub-dir e.g: /cmsms
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.

RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]


# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]



---------------------------------------------------

Then, I added code to remove www. and instances of the index file.

---------------------------------------------------
#301 Redirect eliminates www. prefix
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domina.com/$1 [R=301,L]

#Stops index.html and index.php from showing up
RewriteCond %{THE_REQUEST} ^.*\/index\.html?
RewriteRule ^(.*)index\.html?$ http://domain.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^.*\/index\.php?
RewriteRule ^(.*)index\.php?$ http://domain.com/$1 [R=301,L]
---------------------------------------------------

My problem is that I still seem to have duplicate content.  While navigating the site, the URLs are .com/content.html or .com/category/content.html.  That's great.

However, I can call duplicate pages by entering .com/?page=content or .com/index.php/?page=content.  The index.php will disappear but the ?page=content part stays.  

Is there a way to prevent ?page=content from showing and only show content.html
Last edited by FireNetStudios on Wed Nov 04, 2009 2:14 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: mod_rewrite issue

Post by calguy1000 »

This is NOT a duplicate content issue.

Just because a page can be addressed numerous ways, doesn't mean that the search engines will consider it duplicate content...(unless you've done silly things like submit your URL to google THEN implement pretty URLS).... search engines CRAWL sites... they don't guess URLS.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: mod_rewrite issue

Post by Jeff »

Nope, there will always be multiple ways to enter a URL for a page, but that doesn't matter for SEO as long as the URLs created in your site are the same then it is good for SEO.
FireNetStudios
New Member
New Member
Posts: 5
Joined: Tue May 26, 2009 7:11 pm

Re: mod_rewrite issue

Post by FireNetStudios »

Awesome!  Thanks, guys! (and or gals!)

I was beginning to get a bit frustrated.  I got the .htaccess to strip the query string but then all the pages returned 404.  Which makes sense if it won't let the browser access that page.  lol

Thanks again!
Post Reply

Return to “The Lounge”