[solved] what on earth is going on with my redirects?

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
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

[solved] what on earth is going on with my redirects?

Post by ladyr0gue »

Hi I've just dragged my cmsms install over to the live server and set it all up, it all works great except
I had some redirects that were working fine and now they aren't...
this is my htaccess file

Code: Select all

<Files "config.php">
order allow,deny
deny from all
</Files>
# Sets your error documents
# not absolutely essential to have, 
# or you may already have error pages defined elsewhere
ErrorDocument 500 /error-500.html
ErrorDocument 401 /error-401.html
ErrorDocument 403 /error-403.html

# No sense advertising what we are running
ServerSignature Off

# END Optional Settings

# BEGIN CMSMS and Rewrite Rules
# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine on

# Might be needed in a subdirectory
#RewriteBase /



# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]


# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<__script__>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
RewriteRule ^.*$ - [F,L] 
# END Filtering

# CMSMS Rewriting

# Rewriting old pages to new
RewriteRule ^contact.php$ contact.html [R=301,L]
RewriteRule ^thanks.php$ thanks.html [R=301,L]
RewriteRule ^sitemap.htm$ welcome.html [R=301,L]


# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS

well.. they get me where I want to go - but if I type in contact.php for example the url is "http://www.example.com/vhome_test/19/4 ... ntact.html
what the hey???
Last edited by ladyr0gue on Wed May 02, 2012 11:19 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: what on earth is going on with my redirects?

Post by Rolf »

After the move, did you change all paths in the config.php?

Clear cache?

Perhaps try:

Code: Select all

RewriteRule ^contact.php$ http://www.website.com/contact.html [R=301,L]
grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: what on earth is going on with my redirects?

Post by ladyr0gue »

Rolf wrote:
Perhaps try:

Code: Select all

RewriteRule ^contact.php$ http://www.website.com/contact.html [R=301,L]
grtz. Rolf
and that was it, thank you Rolf :)
Post Reply

Return to “CMSMS Core”