Documentation

Light-weight, fast, simple and powerful!
 

Differences

This shows you the differences between two versions of the page.

administration:removing_the_question_mark_from_the_url [2013-08-21 23:36]
David added IIS information
administration:removing_the_question_mark_from_the_url [2014-08-17 00:26] (current)
mvdkleijn Migration message
Line 1: Line 1:
-====== Removing the question mark from the url ====== +This information has been migrated to http://docs.wolfcms.org/
- +
-The default installation of Wolf CMS generates a question mark in the URLs it generates. This is for compatibility purposes, so Wolf CMS will run on almost any HTTP server by default. +
- +
-However, most people (and search engines) don't really like this question mark. You can disable/remove the question mark after you installed Wolf CMS. +
- +
-By default, Wolf CMS supports Apache. Other HTTP servers are supported based on user input. +
- +
-<note>Updated to reflect Wolf CMS 0.6.0</note> +
- +
-<note important>You must carry out **both** the "General actions" **and** the additional instructions for your specific webserver (Apache, Lighttpd, etc.).</note> +
- +
-===== General actions ===== +
- +
-The following actions should always be executed in order for Wolf CMS to use clean urls. +
- +
-  - Temporarily add write permissions to the **config.php** file.((In Unix/Linux: chmod 666 config.php)) +
-  - Edit the **config.php** file +
-  - Change the value of "**USE_MOD_REWRITE**" to "true". +
-  - Save the **config.php** file. +
-  - Remove the write permissions from the **config.php** file. **//Don't forget or skip this step!//**((In Unix/Linux: chmod 444 config.php)) +
-  - Apply the directions for your specific HTTP server. See below. +
-  - After applying the directions, test out the change by going to the root of your website. You should no longer see the question mark. +
- +
- +
-===== Apache HTTP server actions ===== +
- +
-  - Edit the **_.htaccess** file located in the Wolf CMS root directory. +
-  - Find the line starting with ''RewriteBase /wolfcms/''.\\ - If Wolf CMS lives in the root of your site (for example: <nowiki>www.mypage.com</nowiki>), delete the "wolfcms/" part so the line equals: ''RewriteBase /''.\\ - If Wolf CMS lives in a subdirectory of your site (for example: <nowiki>www.mypage.com/mywolf</nowiki>), change the "/wolfcms/" part so the line equals: ''RewriteBase /mywolf/''. +
-  - Save the **_.htaccess** file. +
-  - Rename the **_.htaccess** file into **.htaccess** (i.e. remove the underscore). +
- +
- +
-===== Lighttpd server actions ===== +
- +
-The paths used in the rewrite code below assume that your Wolf CMS installation lives at the root of the site, i.e. <nowiki>http://www.example.com</nowiki>. +
- +
-Since Lighttpd does not have an equivalent of Apache's RewriteBase command, you will have to manually alter the paths below to conform to your Wolf CMS root. +
- +
-<code> +
-#  +
-# Wolf CMS mod_rewrite rules for lighttpd +
-+
-# If your Wolf CMS install lives in a sub-directory like: http://www.example.com/mywolf/ +
-# you should add the subdirectory between ^ and / in the rules below and in the +
-replacement +
-# value, for example: "^/mywolf/admin(.*)$" => "/mywolf/admin/index.php?$1", +
-+
-url.rewrite-once = ( +
- +
-    "^/install/index.html$" => "/install/index.php?rewrite=1", +
-    "^/install/index.php$" => "/install/index.php?rewrite=1", +
-    "^/install/$" => "/install/index.php?rewrite=1", +
-    "^/install/(.*)$" => "/install/$1", +
- +
-    "^/admin/(images|javascripts|stylesheets|themes)/(.*)" => "/admin/$1/$2", +
-    "^/admin/index.php\?(.*)$" => "/admin/index.php?$1", +
-    "^/admin(.*)$" => "/admin/index.php?$1", +
- +
-    "^/favicon\.ico$" => "$0", +
-    "^/(public|wolf)/(.*)$" => "/$1/$2", +
- +
-    "^(?:(?!/admin/))/([^?]*)(\?(.*))$" => "/index.php?WOLFPAGE=$1&$2", +
-    "^/(.*)$" => "/index.php?WOLFPAGE=$1" +
- +
-+
-</code> +
- +
-If you are using Wolf CMS 0.7.x, the location of some of the pages has changed.  You will need to use the following instead.  Since this uses ''url.rewrite-if-not-file'', you will need at least version 1.4.24 of lighttpd. +
- +
-<code> +
-url.rewrite-once = ( +
- +
-    "^/wolf/install/index.html$" => "/wolf/install/index.php?rewrite=1", +
-    "^/wolf/install/index.php$" => "/wolf/install/index.php?rewrite=1", +
-    "^/wolf/install/$" => "/wolf/install/index.php?rewrite=1", +
-    "^/wolf/install/(.*)$" => "/wolf/install/$1", +
-+
- +
-url.rewrite-if-not-file = ( +
-    "^/([^\?]+)(\?(.*)$)?" => "/index.php?WOLFPAGE=$1&$3" +
-+
-</code> +
- +
-===== Hiawatha server actions ===== +
- +
-The paths used in the rewrite code below assume that your Wolf CMS installation lives in a "site" directory below the root of the system, i.e. <nowiki>http://www.example.com/site</nowiki>. +
- +
-Since Hiawatha does not have an equivalent of Apache's RewriteBase command, you will have to manually alter the paths below to conform to your Wolf CMS root. +
- +
-You will need an UrlToolkit similar to this where 'site' is the folder in the web root where Wolf CMS is unpacked. +
- +
-<code> +
-UrlToolkit { +
-    ToolkitID = wolfcms +
-    Match ^/site/install/index.html$ Rewrite /site/install/index.php?rewrite=1 +
-    Match ^/site/install/index.php$ Rewrite /site/install/index.php?rewrite=1 +
-    Match ^/site/install/$ Rewrite /site/install/index.php?rewrite=1 +
-    RequestURI exists Return +
-    Match ^/site/admin(.*)$ Rewrite /site/admin/index.php?$1 +
-    Match ^/site(.*)$ Rewrite /site/index.php?WOLFPAGE=$1 +
-+
-</code> +
- +
-Remember to enable this toolkit in your Virtual Host. +
- +
-The 3 regex above RequestURI are used for clean url validation during installation only. They must be above RequestURI and can be commented out after installation. +
- +
-You must have PreventSQLi disabled (is also the default I think). +
- +
-===== IIS ===== +
- +
-If you tried to install Wolf on an IIS, you'll notice it works **unless** you activate the clean urls. Clean urls don't work "out of the box", because IIS doesn't support the .htaccess files that are Wolf's default. +
- +
-Instead, you need to create a file named ''web.config'' and save it to the root of the website. In this file you need to add the rewrite rules. Here's what needs to be in this ''web.config'' file: +
- +
-**For WolfCMS 0.7+** (admin inside the wolf folder) +
- +
-<code xml> +
-<?xml version="1.0" encoding="UTF-8"?> +
-<configuration> +
-  <system.webServer> +
-    <rewrite> +
-      <rules> +
-        <rule name="Imported Rule" stopProcessing="true"> +
-          <match url="^(.*)$" ignoreCase="false" /> +
-          <conditions> +
-            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> +
-            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> +
-          </conditions> +
-          <action type="Rewrite" url="index.php?WOLFPAGE={R:1}" appendQueryString="true" /> +
-        </rule>       +
-      </rules> +
-    </rewrite> +
-    <httpErrors errorMode="DetailedLocalOnly" /> +
-  </system.webServer> +
-</configuration> +
-</code> +
- +
-**WolfCMS 0.6** (admin folder in root directory) +
- +
-<code xml> +
-<?xml version="1.0" encoding="UTF-8"?> +
-<configuration> +
-  <system.webServer> +
-    <rewrite> +
-      <rules> +
-        <rule name="Imported Rule 1" stopProcessing="true"> +
-          <match url="^(.*)$" ignoreCase="false" /> +
-          <conditions> +
-            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> +
-            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> +
-          </conditions> +
-          <action type="Rewrite" url="index.php?WOLFPAGE={R:1}" appendQueryString="true" /> +
-        </rule>       +
-        <!--# Administration URL rewriting. --> +
-        <rule name="Imported Rule 2" stopProcessing="true"> +
-          <match url="^admin(.*)$" ignoreCase="false" /> +
-          <conditions> +
-            <!--#Setting Frog requirements--> +
-            <!--#php_flag magic_quotes_gpc off--> +
-            <!--#Setting rewrite rules--> +
-            <!--# Set next line to your Wolf root ? if not in subdir, then just / --> +
-            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> +
-            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> +
-          </conditions> +
-          <action type="Rewrite" url="admin/index.php?{R:1}" appendQueryString="true" /> +
-        </rule> +
-      </rules> +
-    </rewrite> +
-    <httpErrors errorMode="DetailedLocalOnly" /> +
-  </system.webServer> +
-</configuration> +
-</code> +
- +
-<note important>Note: At one point, I was getting an error 500 from the server and I thought the problem came from the web.config file. It turned out that I had opened a php tag as <? instead of <?php. So if you encounter the same problem, verify your php tags!</note> +
- +
-//Thanks to **steven**, who posted this [[http://www.wolfcms.org/forum/topic2793.html|information in the forum]].// +
- +
-===== Nginx server directives ===== +
- +
-Put the following code in your server block:  +
-<code> +
-try_files $uri $uri/ /index.php?WOLFPAGE=$uri&$args; +
-</code> +
-<note>Note: the code above assumes that your Wolf CMS installation lives at the folder defined by the root directive. For more information about Nginx rewriting, visit [[http://wiki.nginx.org/NginxHttpCoreModule#try_files|here]].</note> +
- +
-You may also have to set the URL suffix to be blank <code>define('URL_SUFFIX', '');</code> in config.php +
- +
-===== Zeus server actions ===== +
- +
-<code> +
-map path into SCRATCH:path from %{URL}            +
-look for file at %{SCRATCH:path}            +
-if exists then goto END            +
-look for dir at %{SCRATCH:path}            +
-if exists then goto END            +
- +
-match URL into $ with ^/(.*)$ +
-if matched +
-    look for file at $1 +
-    if not exists +
-        set URL=/index.php?WOLFPAGE=$1 +
-        goto END +
-    endif +
-endif +
-</code>+
 
administration/removing_the_question_mark_from_the_url.txt · Last modified: 2014-08-17 00:26 by mvdkleijn
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Copyright 2010 wolfcms.org / design by yello studio / Wolf CMS Inside