|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
mod_rewrite - .htaccess redirect on page without www
I've got domain.
I want now when user types -> Ww.domain|com redirect on: hTp://domain|com/ The problem is, that I've got .htaccess already: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php RewriteCond %{HTTP_HOST} ^wW.rcdrugs|com$ [NC] RewriteRule ^(.*)$ hTtp://rcdrugs|com/$1 [R=301,L] When I enter:: hTp://wW.domain|com/help it redirects me to: hTtp://domain|com/index.php My full rewrite rule is above. I want to get: hTp://wW..../help -> hTp://.../help. P.S. "We are sorry, new user accounts are not permitted to create posts containing URLs. Please review our forum rules for more information." |
|
#2
|
|||
|
|||
|
Hello,
Instead of: Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
How about trying this? Code:
RewriteRule ^$ /index.php [R=301] Full example: Code:
RewriteEngine On
RewriteBase /
RewriteRule ^$ /index.php [R=301]
RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule (.*) http://domain.com/$1 [R=301,L]
I hope it helps. |
|
#3
|
|||
|
|||
|
With this configuration site isn't working...
Edit. Know on old configuration website started to work as I expect . WeirdThanks for help. Anyway |
|
#4
|
|||
|
|||
|
Can you please elaborate "isn't working"?
My example code works fine for me so I do not really know why it does not work for you. Edit: I see you edited your post after I started writing this. I'm glad you sorted it out on your own. ![]() |
|
#5
|
|||
|
|||
|
Maybe it works, but my website engine code is complicated a bit and it throws errors (can't load module). But everything is ok now! THANKS for HELP!
|
|
#6
|
|||
|
|||
|
I see. That is great
![]() |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > mod_rewrite - .htaccess redirect on page without www |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|