.htaccess

How to stop search engines from crawling the whole website?

狂风中的少年 提交于 2020-01-12 03:13:05
问题 I want to stop search engines from crawling my whole website. I have a web application for members of a company to use. This is hosted on a web server so that the employees of the company can access it. No one else (the public) would need it or find it useful. So I want to add another layer of security (In Theory) to try and prevent unauthorized access by totally removing access to it by all search engine bots/crawlers. Having Google index our site to make it searchable is pointless from the

Detect iPhone browser in .htaccess/apache and redirect to iPhone site

混江龙づ霸主 提交于 2020-01-12 02:41:28
问题 Is it possible to detect iPhone browser agent in .htaccess and redirect the user to the correct iPhone page? 回答1: Sure you can - #redirect mobile browsers RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$ RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301] RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$ RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301] RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$ RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301] Taken from here 回答2: A little Googling,

PHP Routing - stylesheets have no effect

时光毁灭记忆、已成空白 提交于 2020-01-11 14:23:08
问题 I have created a basic Routing-system in PHP. The url is split into an array, so that i can decide what to show depending on the URL (ex: www.domain.com/page/option/param). So in my index.php I've defined a div for header, content and footer, and the /page/ determines which file to include in the content-div. The routing works, and the HTML is loaded, but the stylesheet doesn't seem to be. Neither does it work when I <link> the stylesheet directly in the file (and supposedly it's possible to

PHP Routing - stylesheets have no effect

旧城冷巷雨未停 提交于 2020-01-11 14:23:07
问题 I have created a basic Routing-system in PHP. The url is split into an array, so that i can decide what to show depending on the URL (ex: www.domain.com/page/option/param). So in my index.php I've defined a div for header, content and footer, and the /page/ determines which file to include in the content-div. The routing works, and the HTML is loaded, but the stylesheet doesn't seem to be. Neither does it work when I <link> the stylesheet directly in the file (and supposedly it's possible to

Mobile Redirect to desktop version using htaccess

送分小仙女□ 提交于 2020-01-11 14:06:23
问题 I have a website called www.example.com I have a mobile website called m.example.com firstly i want to redirect automatically from desktop version to mobile site (if it is mobile only.. i want to detect all mobile versions) then I want to use an htaccess to automatically redirect the main website URL to the mobile version.. However, there is a link on the mobile version that points back to the main website called www.example.com/?nm=1 ( nm mean nomobile ) i want to set cookie for this one..

massive Issue with Caching and ModExpire on php Files

a 夏天 提交于 2020-01-11 13:48:19
问题 I do have a massive Issue with Caching and ModExpire on php Files if i'am using following in my global .htaccess <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType text/html "access plus 600 seconds" ExpiresByType application/javascript "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" ExpiresByType application/xhtml-xml "access plus 600 seconds" ExpiresByType

mod-rewrite redirect child URL to parrent URL

落花浮王杯 提交于 2020-01-11 13:41:06
问题 in .htaccess I would like to chop off anything after the 2nd '/'… so http://www.domain.com/parent/child/otherchild would be redirected to http://www.domain.com/parent/ 回答1: Add these rules to the htaccess file in your document root: RewriteEngine On RewriteRule ^([^/]+)/.+$ /$1/ [L,R=301] Not sure what you meant by pasting all that unreadable code in the comments, but you want to add exclusion conditions like I mentioned in my comments: AddType application/octet-stream vcf # BEGIN WordPress

How to remove GET parameters from url with htaccess?

喜夏-厌秋 提交于 2020-01-11 13:30:49
问题 My website do not use any GET parameters except on one page. Nonetheless, I can see that Google managed to index a bunch of my pages with GET parameters. This is not great for SEO (duplicate content)... So I'm trying to edit my .htaccess to do 301 redirects between all urls with GET parameters to url without GET parameters (except for one url). Some examples: example.com/?foo=42 => example.com/ example.com/about?bar=42 => example.com/about example.com/r.php?foobar=42 => the url r.php should

How to make Pretty URL using .htaccess

霸气de小男生 提交于 2020-01-11 13:21:07
问题 I have link http://musicfoorti.com/categorylist/57/0/1.html http://musicfoorti.com/fileDownload/75/jhalak-dikhla-jaa-reloadedmp3.html http://musicfoorti.com/download/75.html and I want to make links look like below http://musicfoorti.com/music.html http://musicfoorti.com/jhalak-dikhla-jaa-reloadedmp3.html http://musicfoorti.com/jhalak-dikhla-jaa-reloadedmp3/download.html Here is my .htaccess code Options -MultiViews +FollowSymlinks -Indexes <IfModule mod_security.c> SecFilterEngine Off

htaccess pretty URL with PHP & URL variables

独自空忆成欢 提交于 2020-01-11 13:19:12
问题 hoping someone can offer some assistance here. This is an issue with multiple layers. In short, I want to have pretty URLs that use a URL variable to a file within a folder. So, I want http://www.example.com/?page=path/to/page to look like http://www.example.com/path/to/page/ On the index.php page, to load the above content: require_once('content/'.$_GET['page'].'.php'); Current htaccess configuration: RewriteEngine On # Add trailing Slash RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*[