How can I disable/forbid/block several page aliases?

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.
Locked
Albert
New Member
New Member
Posts: 6
Joined: Tue Mar 03, 2009 3:13 am

How can I disable/forbid/block several page aliases?

Post by Albert »

CMSMS 1.53, Apache/1.3.41 (Unix) PHP/5.2.6, virtual hosting.
Some page aliases cannot be visible in admin interface, but nevertheless matching urls exist and server returns 200. I want those responses to be 404 or "moved".
The links I mean, left in the web by previous versions of CMS Made Simple and look like http://mysite.com/existing-page-alias/1/59.html. The goal is to make search engines "to bury" such urls permanently, because of now they lead to wrong pages due to unknown reason.
Last edited by Albert on Thu Apr 16, 2009 1:22 am, edited 1 time in total.
JeremyBASS

Re: How can I disable/forbid/block several page aliases?

Post by JeremyBASS »

I'm not sure if you where trying to be funny... but if you had a page and moved it you need to do a redirect to the new area... that's how you get search engines to drop it...

Read here http://www.google.com/support/webmasters/?hl=en

you'll find that you'll most likely need to do an .htaccess rule to get you going...

Hope that helps...

Cheers
jeremyBass
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How can I disable/forbid/block several page aliases?

Post by Dr.CSS »

Sorry but this has nothing to do with CMS Made Simple...
Albert
New Member
New Member
Posts: 6
Joined: Tue Mar 03, 2009 3:13 am

a-a-a... not so fast!

Post by Albert »

Continuing the http://forum.cmsmadesimple.org/index.php/topic,32775.0.html

Wrong answers!
.htaccess ain't rules in this case, cause looping happens every time you REDIRECTING the urls in above-mentioned topic with any rewrite rule. There is only the one thing I've done successfully - I've cheated the server like this, pointing it to non-existing file:

Code: Select all

# BEGIN Optional settings

# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without 
# needing empty index.html files everywhere
Options -Indexes

# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file.  This may also break other programs you have running under your CMSms
# install that use config.php.  You may need to add another .htaccess file to those
# directories to specifically allow config.php.
<Files "config.php">
order allow,deny
deny from all
</Files>

# Sets your 403 error document
# not absolutely essential to have, 
# or you may already have error pages defined elsewhere
#ErrorDocument 403 /custom403.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 /

# 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]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
#OR if the URI contains a *
RewriteCond %{QUERY_STRING} \* [OR]
#IF the URI contains UNION
RewriteCond %{QUERY_STRING} UNION [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
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS
RewriteCond %{QUERY_STRING} /1/15\.html [NC,OR]
RewriteCond %{QUERY_STRING} /1/51\.html [NC,OR]
RewriteCond %{QUERY_STRING} /1/52\.html [NC,OR]
RewriteCond %{QUERY_STRING} /1/53\.html [NC,OR]
RewriteCond %{QUERY_STRING} /1/59\.html [NC,OR]
RewriteCond %{QUERY_STRING} /2/15\.html [NC,OR]
RewriteCond %{QUERY_STRING} /2/51\.html [NC,OR]
RewriteCond %{QUERY_STRING} /2/52\.html [NC,OR]
RewriteCond %{QUERY_STRING} /3/15\.html [NC,OR]
RewriteCond %{QUERY_STRING} /3/51\.html [NC,OR]
RewriteCond %{QUERY_STRING} /3/52\.html [NC]
RewriteRule ^.*$ non-existing-file

# END Rewrite rules
Thus, as more experienced, YOU should work on this more thoroughly.
Locked

Return to “CMSMS Core”