I applied the following mod_rewrite
rule in Apache2
to redirect from non www to www:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
I have two questions:
1) There's a double slash issue:
Any tips to fix it?
2) Is my configuration good for SEO?
Particularly as a double slash in written work usually means "new line here".
Two backslashes are used as a prefix to a server name (hostname). For example, \\a5\c\expenses is the path to the EXPENSES folder on the C: drive on server A5.
Lines beginning with // are comments and are ignored during action execution.
mod_rewrite is an Apache module that allows for server-side manipulation of requested URLs. mod_rewrite is an Apache module that allows for server-side manipulation of requested URLs. Incoming URLs are checked against a series of rules. The rules contain a regular expression to detect a particular pattern.
Fixed with:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com$1 [R=301,L]
because $1
by default contains the index path /
RewriteRule ^\/?(.*)$ http://www.mydomain.com/$1 [R=301,L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With