EDIT: FIXED

Well, after tripping for this site and Google for any couple of hrs, I discovered the issue:

Bad code:

RewriteCond % !^world wide web.domain.com$ [NC]

RewriteRule ^(.*)$ http://world wide web.domain.com/$1 [L,R=301]

Good code:

RewriteCond % !^world wide web.domain.com$ [NC]

RewriteRule ^(.*)$ http://world wide web.domain.com% [L,R=301]

The REQUEST_URI appears not to work like $1... so I am learning mod_rewrite hard way.


The question:

Conditions:

  • fundamental rewrite rules for Search engine optimization web addresses

  • domain redirect from domain.com to world wide web.domain.com

Problem:

The non-world wide web.domain.com pages lose their Search engine optimization-web addresses and reverse towards the original php variables:

Ex.

Search engine optimization-url: world wide web.domain.com/Video+1234

NonWWW url: domain.com/Video+1234

Result (browser address bar):

world wide web.domain.com/index.php?video=1234

Preferred:

world wide web.domain.com/Video+1234

How do i result in the server keep your old form?

.htaccess snippet:

RewriteEngine On

# RewriteBase /

RewriteRule ^Video-(.+)+([-9]+)$ index.php?video=$2

RewriteCond % !^world wide web.domain.com$ [NC]

RewriteRule ^(.*)$ http://world wide web.domain.com/$1 [L,R=301]

Have your rules such as this:

RewriteEngine On

Options +FollowSymlinks -MultiViews

RewriteRule ^Video+([-9]+)$ http://world wide web.domain.com/index.php?video=$2 [L,NC]

RewriteCond % !^world wide web.domain.com$ [NC]

RewriteRule ^(.*)$ http://world wide web.domain.com/$1 [L,R=301]

L in first rule can make it stop after using that rule. Tell me whether it does not work.

Well, after tripping for this site and Google for any couple of hrs, I discovered the issue:

Bad code:

RewriteCond % !^world wide web.domain.com$ [NC]

RewriteRule ^(.*)$ http://world wide web.domain.com/$1 [L,R=301]

Good line:

RewriteCond % !^world wide web.domain.com$ [NC]

RewriteRule ^(.*)$ http://world wide web.domain.com% [L,R=301]

The REQUEST_URI appears not to work like $1... so I am learning mod_rewrite hard way.