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
[Resolved] mod_rewrite issue
-
- New Member
- Posts: 5
- Joined: Tue May 26, 2009 7:11 pm
[Resolved] mod_rewrite issue
Last edited by FireNetStudios on Wed Nov 04, 2009 2:14 pm, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: mod_rewrite issue
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.
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.
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.
Re: mod_rewrite issue
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.
-
- New Member
- Posts: 5
- Joined: Tue May 26, 2009 7:11 pm
Re: mod_rewrite issue
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!
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!