Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

.htaccess config
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: .htaccess config

.htaccess config 17 years, 7 months ago #1970

After a great deal of searching and frustration, I am using this .htaccess, copied from another forum user -

Options +FollowSymLinks
DirectoryIndex index.php
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]
RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
# Security x 2 #
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any 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 modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#

However, I want to use the redirect for the www. prefix to help with SEO. so that www.endurancepro.net and endurancepro.net are the same to the search engines.

The standard pattern is to add

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^endurancepro.net [NC]
RewriteRule ^(.*)$ www.endurancepro.net/$1 [L,R=301]

This breaks the site and I get a 404 error on the public side of the site but the admin still works.

Since line 1 and 2 are duplicates, I have tried deleting them and still get the same result.

Any suggestions on how to solve this problem?<br><br>Post edited by: drblbaker, at: 2007/04/26 00:53

Re:.htaccess config 17 years, 6 months ago #2037

  • miun
  • OFFLINE
  • A pesimist is just a well-informed realist.
  • Posts: 563
Hello,

you will need to put the rules into a correct order and also to use the correct switches. The site name rewrite rules

RewriteCond %{HTTP_HOST} ^endurancepro.net [NC]
RewriteRule ^(.*)$ www.endurancepro.net/$1 [L,R=301]

should preceede the other Joomla! rules. So you need to place this between the RewriteEngine On and other Joomla rules.

Generally, there is however no real need to do this, because you Joomla is always using just one, primary URL, that you have configured in your configuration.php file. If the DNS records of your domain then point both site.xy and www.site.xy to your server where Joomla! is running, right after the first page, all following pages will use one of these URLs, because Joomla will generate all its links based on what is in you configuration file. But it may also depend on your web server and DNS configuration.

Best regards,
ARTIO Support Team
ARTIO Support Team
  • Page:
  • 1
Přihlášení uživatele Prázdný