הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   שאלה בקשר ל-www. (https://hosts.co.il/forums/showthread.php?t=101265)

Crazyer 26-11-12 20:07

שאלה בקשר ל-www.
 
אני מעוניין שאייך שנכנסים מהאתר נניח xxxxxx.co.il שזה יעביר אוטומטית ל-www.xxxx.co.il

כיצד עושים זאת?

Mati Menkes 26-11-12 20:18

תיצור קובץ בשם .htaccess ושהתוכן בו יהיה:
ציטוט:

# Turn on URL rewriting
RewriteEngine On

# Installation directory
# RewriteBase /test/
Options +FollowSymlinks

# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]

#redirec

#detect urls without www
RewriteCond %{http_host} ^blabla.com [NC]

#redirect to www, does not work though
RewriteRule ^(.*)$ http://www.blabla.com/$1 [R=301,L]

AddHandler php5-script .php

EliranE 26-11-12 20:26

ציטוט:

נכתב במקור על ידי Mati Menkes (פרסם 864216)
תיצור קובץ בשם .htaccess ושהתוכן בו יהיה:

אתה רציני? את כל זה?

קוד:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^url.co.il [NC]
RewriteRule ^(.*)$ http://www.url.co.il/$1 [L,R=301]


Kernel 26-11-12 20:28

עושים חיפוש בפורום,
שאלו את השאלה הזאת אולי 500 פעם.

michaelkalfon 26-11-12 21:01

תיצור דף בשם - .htaccess .

ושים את זה בפנים :

קוד:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.XxX.co.il
RewriteRule (.*) http://www.XxX.co.il$1 [R=301,L]


Crazyer 26-11-12 22:59

תודה


כל הזמנים הם GMT +2. הזמן כעת הוא 15:59.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ