Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED Force www
#1
When I force www through htaccess it seems to break the preety url structure.
EX
Code:
http://example.com/prettyurl
But when I force www it seems to default back.
EX
Code:
http://www.example.com/index.php?id=prettyurl
When I edit the forced www to display the way I want I get 404 errors.
Here is a copy of my htaccess file
Code:
#
# GetSimple CMS htaccess ROOT file
# apache 2.4
#

# The following require certain allow overrides, if getting 500 error comment them out one by one
# can be resolved in apache httpd.conf to ensure security alternatives

# override charset
AddDefaultCharset UTF-8

# prevent directory listings
Options -Indexes

# Follow symbolink links, This is required for rewrites on some hosts
Options +FollowSymLinks

# Set the default handler.
DirectoryIndex index.php

# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
<IfModule mod_access_compat.c>
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
<IfModule !mod_access_compat.c>
Require all denied
</IfModule>
</IfModule>
</Files>

<Files sitemap.xml>
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_access_compat.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
<IfModule !mod_access_compat.c>
Require all granted
</IfModule>
</IfModule>
</Files>

# handle rewrites for fancy urls
<IfModule mod_rewrite.c>
RewriteEngine on

# Usually RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Reply


Messages In This Thread
Force www - by chien - 2015-05-04, 11:04:28
RE: Force www - by shawn_a - 2015-05-04, 12:26:33
RE: Force www - by chien - 2015-05-04, 12:38:41
RE: Force www - by chien - 2015-05-04, 12:41:23



Users browsing this thread: 1 Guest(s)