CMSMS Url 重写

CMSMS Url rewrite

LE: 发现我的解释能力很差所以我会在最后快速主题 tl;dr。

我最近接到了一个项目,这意味着要在 CMSMS(CMS Made Simple)上定制一个网站。网站版本是 1.11.2 我正在使用 Apache 和 mod_rewrite 来处理 url 重写。 我一直在尝试解决与 URL Rewrite 相关的一件小事,但我就是无法克服它。

网站安装了博客模块CGBlog。 为了显示博客的内容,我需要一个页面(以及该页面的模板,但我们会将模板排除在讨论之外,因为它没有解决问题)在哪里溢出所有 post秒。基本上,一个通用的 category/archive 页面。 因此我用 URL 'blog' 创建了一个名为 'Blog' 的页面。 到目前为止,不考虑博客,我们会有类似示例的内容。com/blog.

博客可以选择在每个 post 之前添加前缀。所以我可以制作类似 example.com/any_prefix_here/title-of-post 的东西。此外,当在博客 post 中时,它不会记录 archive/category 页面的调用方式。 所以我一直在使用这个前缀选项来使 url 看起来一样。例如:example.com/blog 和在文章中 example.com/blog(添加为前缀)/title-of-the-post.

现在的问题是,如果我尝试保留名为 'blog' 的博客页面的名称,我将无法访问它。com/blog 否则我将被禁止访问 403。如果我通过示例访问它。com/anything/blog 它会起作用。如果我将该页面命名为 blog2,那么我就可以访问它作为示例。com/blog2。我不知道 'blog' 这个词是怎么回事。我也不知道如何绕过 403 forbidden。

我什至尝试通过 .htaccess 以某种方式重写它,但没有成功。

目前这是我的 htaccess。

    # Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# (this is important, so uncomment if your host permit)
Options -Indexes
ServerSignature Off

Options +FollowSymLinks

# To prevent E_STRICT problems with PHP 5.3+ you can uncomment the following lines
# Note: These settings should only be enabled for production sites!
#php_flag display_startup_errors 0
#php_flag display_errors 0
#php_flag html_errors 0
#php_value docref_root 0
#php_value docref_ext 0

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# redirects /index.php?page=asfd to /asdf
RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L,NE]

# redirects /index.php/asfd to /asdf
RewriteCond %{THE_REQUEST} /index\.php/([^?\s]+)\s [NC]
RewriteRule ^ /%1 [R=302,L,NE]

RewriteCond %{THE_REQUEST} ^.*/index\.php 
RewriteRule ^(.*)index.php$ / [R=301,L] 

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

RewriteCond %{HTTP_HOST} ^connsys.ro
RewriteRule (.*) http://www.connsys.ro/ [R=301,L]
</IfModule>


<IfModule mod_header.c>
# Disable ETags
Header unset ETag
FileEtag None
</IfModule>

<IfModule mod_deflate.c>
# Compress css, plaintext, xml, gif, and images in transport.
AddOutputFilterByType DEFLATE text/css text/plain text/xml image/gif image/jpeg image/png
</IfModule>

<IfModule mod_expires.c>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
# Set expires tags on various files... so that the browser wont attempt to reload them.
ExpiresActive On
ExpiresDefault "access plus 1 year"
<IfModule mod_header.c>
  # Setting cache control to public allowes proxy servers to cache the items too.
  Header set Cache-Control "public"
</IfModule>
</FilesMatch>
</IfModule>

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

<IfModule mod_headers.c>
# WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf|woff)$">
    Header set Cache-Control "max-age=604800, public"
</FilesMatch>
</IfModule>

Tl;dr: url 将 problem/permission 问题重写到博客页面。页面名为 'Blog',slug/url 为 'blog'。例如,我无法访问博客。com/blog 因为我被禁止访问 403。如果我访问博客作为示例。com/anything/blog 它有效。如果我将页面重命名为 blog2,它可以作为示例。com/blog2.

我该如何处理这个问题?如果您不投反对票并告诉我我做错了什么以防万一我解释错了,我将不胜感激。

谢谢

是否存在名为blog的真实目录?没有禁用索引 file/auto-indexing,或者权限不正确?