Szerző Téma: www előtag furcsaság [Megoldva]  (Megtekintve 1061 alkalommal)

Nem elérhető gabor

  • Full Member
  • ***
  • Hozzászólások: 120
www előtag furcsaság [Megoldva]
« Dátum: 2010. január 30. 16:11 »
Sziasztok.

Adott egy CMSMSben készülő honlap, mod_rewrite beállítva, király seo barát címekkel.
A config.php "$config['root_url'] = 'http://www.valami.hu
sorában www. van beállítva, a fömenü linkjei is ugy jelennek meg ha link fölé viszem az egerem, de ha rákattantok az egyikre, akkor www. nélkül jön be az oldal.
 
Google ezt két külön oldalként kezeli, úgy is indexelte le öket korábban. :)
Webmaster toolsban már beállítottam, hogy a www. legyen a favorit neki, de szeretném teljesen kiküszöbölni a dolgot.

Jelenleg az alap beállítás van a .htaccess-ben,

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

Ezzel minden ok.

Találtam további infót az előtag átirányításra:

 # =============================================================
   <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteBase /
 #   -----------------------------------------------------------
     RewriteCond %{HTTP_HOST} !^www\.mywonderfulsite\.com [NC]
     RewriteRule ^(.*)  http://www.mywonderfulsite.com/$1 [L,R=301]
 #   -----------------------------------------------------------
   </IfModule>
 # =============

Kérdésem, hogy a kettöt, hogy lehet ötvözni? Nekem nem sikerült.
Válaszokat elöre is köszönök!:)
« Utoljára szerkesztve: 2010. január 31. 16:09 írta gabor »

Nem elérhető gabor

  • Full Member
  • ***
  • Hozzászólások: 120
Re: www előtag furcsaság
« Válasz #1 Dátum: 2010. január 30. 16:21 »
más honlapnál nem volt ilyen probléma a linkekkel, a mod_rewrite beállítása után simán ment minden, a tárhely szolgáltató ugyanaz mindkét esetben.

Nem elérhető gabor

  • Full Member
  • ***
  • Hozzászólások: 120
Re: www előtag furcsaság
« Válasz #2 Dátum: 2010. január 31. 16:08 »
a nagyban megtaláltam, müködik:  8)

# BEGIN Optional settings

# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without
# needing empty index.html files everywhere
Options -Indexes

# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file.  This may also break other programs you have running under your CMSms
# install that use config.php.  You may need to add another .htaccess file to those
# directories to specifically allow config.php.
<Files "config.php">
order allow,deny
deny from all
</Files>

# Sets your 403 error document
# not absolutely essential to have,
# or you may already have error pages defined elsewhere
ErrorDocument 403 /forbidden403.shtml

# No sense advertising what we are running
ServerSignature Off

# END Optional Settings

# BEGIN CMSMS and Rewrite Rules
# Make sure you have Options FollowSymLinks
# and Allow on

RewriteEngine On

# Might be needed in a subdirectory
#RewriteBase /
# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]

#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]

#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]

#OR if the URI contains a "<script>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]

#IF the URI contains UNION
RewriteCond %{QUERY_STRING} UNION [OR]

#OR if the URI contains a *
RewriteCond %{QUERY_STRING} \*

#then deny the request (403)
RewriteRule ^.*$ - [F,L]

# End URL Filtering

# force CMSMS www IN URL
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# END CMSMS force www IN URL


# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Nem elérhető SPétör

  • Administrator
  • Hero Member
  • *****
  • Hozzászólások: 2 294
    • CMS Made Simple - Magyarország
Re: www előtag furcsaság [Megoldva]
« Válasz #3 Dátum: 2010. január 31. 19:26 »
Remélem jól elbeszélgettél magaddal...  ;) Bocs', hogy nem tudtunk segíteni.
Köszönjük az ötletet!!!
[SP]

Számításaim szerint az én problémám nem is létezik.
--
http://www.cmsmadesimple.hu