Empty request associated with primary URL .htaccess issue

I use .htaccess to clear my url. It works great when you click on various links, for example, www.example.com/el-nino-effect. However, when I go directly to www.example.com, it takes me to www.example.com/index?iden=, and not just to www.example.com. Although this is the same page, this primary URL is somehow wrapped. You can help?

The fourth point is where the clean URL is present in .htaccess, but I still host the whole file. Also funny, this problem does not occur in the Chrome browser on Ubuntu, but occurs in the Chrome browser on chroma.

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

## hide .php extension snippet
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

# To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]

# For cleaner URLs making ?q=el-nino to /el-nino
RewriteRule ^([^/\.]+)?$ index.php?iden=$1 [L]
RewriteRule ^([^/\.]+)/?$ index.php?iden=$1 [L]
# RewriteRule ^downloads/([^/\.]+)/?$ downloads.php?id=$1 [L]

# For rewriting to HTTPS
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+4
source share
1 answer

, . :

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

# For rewriting to HTTPS
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

## hide .php extension snippet
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

# To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

# For cleaner URLs making ?q=el-nino to /el-nino
RewriteRule ^([^.]+)/?$ index.php?iden=$1 [L,QSA]
# RewriteRule ^downloads/([^/\.]+)/?$ downloads.php?id=$1 [L,QSA]

.

+1

All Articles