• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 12:22 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 30, 2010 12:16 am
Posts: 100
I have had a devil of a time trying to fox some redirect problems on my site. It sort of worked before, but it had strange 302 redirects that somehow the browser figured out, but it wasn't right for SEO or just general "cleanliness." Can someone here offer their services to help me out?

Here are the problems I know about

Problem #1
Code:
http://www.fbcaa.org/cms/feeds/MAPBlog.rss
301 Moved Permanently
https://www.fbcaa.org/cms/feeds/MAPBlog.rss?page=feeds/MAPBlog.rss
200 OK

This doesn't look right. Before I started to try to fix the extra redirects, it used to just go to
https://www.fbcaa.org/cms/feeds/MAPBlog.rss

But if I click http://www.fbcaa.org/cms/feeds/MAPBlog.rss my browser sends me to http://www.fbcaa.org/cms/

Problem #2
Code:
http://www.fbcaa.org/
302 Moved Temporarily
cms/index.php
301 Moved Permanently
https://www.fbcaa.org/cms/index.php
200 OK


The bare cms/index.php doesn't seem right, as does the 302 redirect.

Problem #3
Code:
https://www.fbcaa.org/
302 Moved Temporarily
cms/index.php
200 OK


First of all, a 302 doesn't seem right. Second of all, the bare cms/index.php isn't right either.

Problem #4
Code:
https://www.fbcaa.org/cms
301 Moved Permanently
https://www.fbcaa.org/cms/
200 OK


I guess this seems OK, but I doubt if anyone visits my site using this url anyway.

Problem #5
If in my browser I type http://www.fbcaa.org, it goes to
https://www.fbcaa.org/cms/index.php
But then if I click my "Home" menu item on the upper left of the Menu, it takes me to
https://www.fbcaa.org/cms/

I don't get why I have two names for my home page.

My CMS installation resides in public_html/cms, which might be part of the problem. I'm happy to have someone correct that if they think it is the best approach.

I have attached public_html/cms/.htaccess. Right now I do not have public_html/.htaccess.

Thanks,

Matt


Attachments:
File comment: My current public_html/cms/.htaccess
htaccess.txt [4.78 KiB]
Downloaded 38 times
Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 12:37 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2875
Location: The Netherlands
Although you ask for commercial support I will give you this free hint :-)

https://www.cmscanbesimple.org/blog/set ... ade-simple

The order of the rules/rewrites is important I guess and you did change it.

First take care of the www and https stuff and then rewrite the pretty url:

Code:
...
#
# The following is to enable pretty URLS, only applicable if url_rewriting is set to 'mod_rewrite' in the config.php
#
<IfModule rewrite_module>
RewriteEngine on
# If your CMSMS installation is in a subdirectory of your domain, you may need to specify the relative path (from the root of the domain) here.
# i.e: RewriteBase /cmsms
RewriteBase /cms

# +++++ ADD THIS - START +++++ from https://www.cmscanbesimple.org/blog/setting-up-ssl-in-cms-made-simple
  # Link to http(s)://website... then redirect to https://www.website...
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

  # Force URLs have https instead of http
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# +++++ ADD THIS - END +++++

# Rewrites urls in the form of /parent/child/grandchild 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]

</IfModule>
...


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 7:58 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 30, 2010 12:16 am
Posts: 100
Thank you very much. I made the change you said. I was not knowledgeable enough to know that the order of rules was critical. My current status is better, but not completely fixed, as far as I understand. Here is the list again:

Problem #1 is SOLVED! This was my worst problem.
Code:
http://www.fbcaa.org/cms/feeds/MAPBlog.rss
301 Moved Permanently
https://www.fbcaa.org/cms/feeds/MAPBlog.rss
200 OK

Problem #2 is NOT SOLVED.
Code:
http://www.fbcaa.org/
302 Moved Temporarily
cms/index.php
301 Moved Permanently
https://www.fbcaa.org/cms/index.php
200 OK

A temporary move to a wrong address followed by a permanent move seems wrong. And I don't even have any 302's in my .htaccess.

Problem #3 is NOT SOLVED.
Code:
https://www.fbcaa.org/ (with or without the trailing slash)
302 Moved Temporarily
cms/index.php
200 OK

Why am I sending the bare cms/index.php back to the browser? It is meaningless.

Problem #4 is SOLVED.
Problem #5 is NOT SOLVED.
Code:
   Two names for my home page. Navigating directly to www.fbcaa.org brings me to
   https://www.fbcaa.org/cms/index.php
   But then if I click my "Home" menu item on the upper left of the Menu, it takes me to
   https://www.fbcaa.org/cms/

Maybe it is not serious.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 8:18 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2875
Location: The Netherlands
Code:
I have attached public_html/cms/.htaccess. Right now I do not have public_html/.htaccess.


Something is done to make your cmsms working from it's sub folder. This is not default behavior. So probably something in public_html is redirecting to cms/index.php. I bet it's a public_html/index.php file with a redirect in it.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 8:56 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 30, 2010 12:16 am
Posts: 100
Yep...public_html/index.php has this in it:

Code:
<?
   header("Location: cms/index.php");
   exit;
?>


This site has run CMS Made Simple for a long time (since at least version 1.4) and it had the CMS stuff in public_html/cms since then. How hard would it be to fix it up for default behavior and fix up these other redirects so they are right?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 9:00 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2875
Location: The Netherlands
Hard to say without having a look at both the backend (CMSMS admin) and having access to the server (cPanel or similar, shell access, database access).

Moving a CMSMS site is usually quite simple. But if there's other work to be done too it can be different of course.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Wed May 03, 2017 9:04 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 30, 2010 12:16 am
Posts: 100
So, I'm hiring if you are interested in the job. I need to get this fixed up properly and you know what you are doing. I don't.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Thu May 04, 2017 12:53 am 
Offline
Forum Members
Forum Members

Joined: Tue Nov 30, 2010 12:16 am
Posts: 100
For the record, if you must have CMS Made Simple installed in public_html/cms or somewhere else, the public_html/index.php redirect should be fully specified, like this:

Code:
<?
   header("Location: https://www.fbcaa.org/cms/index.php", true, 301);
   exit;
?>


The temporary redirects to an abridged URI were coming from the wrong way I had it before:

Code:
<?
   header("Location: cms/index.php");
   exit;
?>


because the header function defaults to return a 302 temporary.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Thu May 04, 2017 7:57 am 
Offline
Forum Members
Forum Members

Joined: Tue Feb 21, 2017 11:04 am
Posts: 17
Hi,

I would love to help you on this. Let connect over S-ky-pe: cis.victor1
OR E-ma-il: victor.cisin10@gmail.com

Regards,
Victor


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Need help to fix htaccess redirects, pretty urls
PostPosted: Fri May 19, 2017 1:05 pm 
Offline
Forum Members
Forum Members

Joined: Fri May 19, 2017 1:03 pm
Posts: 15
Hello,

I have check your post for detail mentioned and know how it can be helped.

let me know your available time and I will do my best to accommodate it.

We can discuss further on skype: deepvyas71

Best Regards,
Deep


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: [SOLVED] Re: Need help to fix htaccess redirects, pretty url
PostPosted: Sun May 21, 2017 8:30 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 30, 2010 12:16 am
Posts: 100
Thanks to user velden, my problem with redirects and pretty urls has been fixed.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
HostPapa CMS Made Simple hosting