Hot answers tagged

3

# Use PHP5.4 as default # Changed PHP handler from application/x-httpd-php54 to application/x-httpd-phpbeta on Thu Dec 17 16:50:26 MST 2015. AddHandler application/x-httpd-phpbeta .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # Insert redirect based rewrites here. # Example: RewriteRule ^redirectme$ ...


3

After some trys and searches I got it working using: RewriteCond %{DOCUMENT_ROOT}/$2 -f [OR] RewriteCond %{DOCUMENT_ROOT}/$2 -d RewriteRule ^([a-z]{2})/(.+)$ /$2 [L,QSA] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L]


3

It's called adaptive web development. You need to detect the user-agent and serve different markup based on the device. In PHP, you can use $_SERVER['HTTP_USER_AGENT']. You'll want to include this code in order to let Google know what you're up to: <?php Header('Vary: User-Agent'); ?> Here's some more info: ...


3

It is fully normal, that traffic drops after such basic change of URL structure. Google needs time to get the new structure, to re-index pages, to understand, whether the content changed and so on. I would say, the drop time is from 1 up to 5-6 weeks long. But you can speed up the re-indexing with new sitemap and new content, which is backlinked externally. ...


2

You can have clean URLs with the following step. Install the wiki into http://localhost/w and NOT into http://localhost/wiki then Modify the following in LocalSettings.php after you have set it up: $wgArticlePath = "/wiki/$1"; In the ROOT directory place the following .htaccess file: RewriteEngine on ## uncomment this rule if you want to redirect to ...


2

This answer comes from memory. If I'm 100% correct with the syntax, you'll want to replaced your 4 commented out lines of code with: RewriteCond %{REQUEST_URI} !^/en(.*)$ RewriteCond %{HTTP:Accept-Language} ^en [NC] RewriteRule ^$ https://www.example.com/en/ [L,R=301] RewriteCond %{REQUEST_URI} !^/it(.*)$ RewriteCond %{HTTP:Accept-Language} ^it [NC] ...


2

and I want my link to be: http://example.com/shaandaar/kinna_sona.html shaandaar and kinna_sona are the slugs in my database. What should I write in my .htaccess file? This is the best way: RewriteEngine On RewriteRule ^([^/]+)/([^/]+)\.html$ /video_in.php?firstslug=$1&secondslug=$2 [L] In the RewriteRule, the ^ starts the matching. This: ...


2

You need to install url_rewrite plugin for IIS. It is available on IIS7 and up though it will tell you that it only works on IIS7. You will then write the redirect commands in web.config and it is very tricky due to the difference of how url_rewrite handles rewriting. The best option I can suggest is to try it out on a local IIS installation with ...


1

The important thing is to place your external redirects before the WordPress internal rewrites (as Mike suggests in his answer). The WordPress rewrites are a "catch all" and rewrite everything. So if you place any rewrites/redirects after the WordPress stuff they will simply be ignored. RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^/?$ ...


1

...Google identifies index.php and the site's root as a single page These two things can totally be different. ...that redirecting index.php to root is not something we should worry about. I'd personally worry about it because: index.php is not a friendly URL especially if it has a query string attached to it. not having a friendly URL could ...


1

I have client who earns pagerank 2 with the same issue as yours. I redirected index.php as default home page into (even) folder /id/. However, I include canonical as an exact information for google to see ... "where my home address is actually" That means that what google needs is our final decision in related to this. As long as we include meta ...


1

A 302 redirect is a temporary redirect. It passes 0% of link juice (ranking power) and, in most cases, should not be used. It is common practice to redirect one URL to another. When doing this, it is critical to observe best practices in order to maintain SEO value. Source: https://moz.com/learn/seo/redirection


1

For a period, you will see a drop-off in traffic before picking up again. Be prepared for this and make sure that management understands that switching from HTTP to HTTPS comes with a price. In theory, though rarely in practice, HTTP and HTTPS are two separate sites. As the search engine drops the HTTP site and indexes the HTTPS site, there will be a ...


1

I use the solution of adding UTM parameters to the redirects. It is the only thing that I've found that works well with Google Analytics. When somebody visits my example.net domain they get redirected to: http://example.com/?utm_campaign=domainnames&utm_medium=domain&utm_source=example.net Then I can get a "campaign" report in Google Analytics ...


1

The rewrite loop is actually caused by rules later in your script: RewriteRule ^(en|it)/(.*) $2?lang=$1 [QSA] RewriteRule ^([^/]+)$ index.php?op=$1 [L,NS,QSA] index.php Having redirected the user to /en/ (with the Accept-Language rules), the first directive here rewrites the request back to ?lang=en (no URL-path) but the second directive then fails to ...


1

If the query string is irrelevant then it can simply be ignored. (You can't match the query string anyway with the RewriteRule directive.) Try the following in your root .htaccess file to redirect the request: RewriteEngine On RewriteRule ^index.php/path/some-path/some-subpath$ /category/? [L,R=301] In per-directory .htaccess files, the URL-path matched ...


1

Yeah, what @alfasin said is right. I use WordPress powered website and I want to force my URL to www & HTTPS version. I use ReallySimpleSSL plugin v2.2.12. The plugin add these code to my root .htaccess # BEGIN rlrssslReallySimpleSSL rsssl_version[2.2.12] <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on [NC] RewriteRule ...



Only top voted, non community-wiki answers of a minimum length are eligible