help:web_pages
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
help:web_pages [2016/10/13 22:52] – peter | help:web_pages [2020/04/15 11:59] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Web Pages ====== | ||
- | |||
- | Having a unique URL (" | ||
- | |||
- | ===== PHP Redirect ===== | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | Header( " | ||
- | Header( " | ||
- | ?> | ||
- | </ | ||
- | |||
- | |||
- | ===== Apache .htaccess: non-www to www subdomain redirect ===== | ||
- | |||
- | 1. Make sure your httpd.conf file has the " | ||
- | |||
- | <code apache> | ||
- | < | ||
- | AllowOverride All | ||
- | </ | ||
- | </ | ||
- | |||
- | |||
- | 2. Enable Mod-Rewrite Module | ||
- | |||
- | Your apache configuration should have the mod-rewrite module enabled, which is the default. You can verify this by perusing httpd.conf file for the following line: | ||
- | |||
- | <code apache> | ||
- | LoadModule rewrite_module modules/ | ||
- | </ | ||
- | |||
- | |||
- | 3. Create a .htaccess file in the document root directory of your website with the following content. | ||
- | |||
- | <code apache> | ||
- | RewriteEngine On | ||
- | RewriteCond %{http_host} ^example.com [nc] | ||
- | RewriteRule ^(.*)$ http:// | ||
- | </ | ||
- | |||
- | Just replace the " | ||
- | |||
- | |||
- | You can permanently redirect non-www URL to the www URL with 301 redirect. For apache web server, you can create a .htaccess file on your document root folder with the following content: | ||
- | |||
- | <code apache> | ||
- | RewriteEngine On | ||
- | RewriteCond %{HTTP_HOST} ^webtrafficexchange.com [NC] | ||
- | RewriteRule ^(.*)$ http:// | ||
- | </ | ||
help/web_pages.1476399174.txt.gz · Last modified: 2020/07/15 09:30 (external edit)