mod-rewrite

.htaccess to mask url and redirect domain name to subdirectory

守給你的承諾、 提交于 2020-01-06 12:45:06
问题 Hi folks I'd appreciate some .htaccess advice. I have two wordpress installations. "A" which is in my ISP's Linux server root directory and "B", which is in a subdirectory of the same server called "directoryB". Actual structure is:= A.com A.com/directoryB/ I own two domain names A.com and B.com. I want people to use the address B.com when accessing everything on directoryB, not A.com/directoryB/. I want to leave the "real" "A" alone - no redirections! I have been assured this can be done

Remove or redirect wrong indexed urls from my website?

£可爱£侵袭症+ 提交于 2020-01-06 12:41:33
问题 This is with the relation of my other questions Spam and Old URLs Modification and Fake URLs created automaticly. Would any body tell me that why they are being created? and I want to redirect below urls. i want to remove extra string or spam from my domain name. i would prefer .htaccess. I am using wordpress. deemasfashion.com/ **cgi-sys/defaultwebpage.cgi** deemasfashion.com/ page/38/wpmp_switcher deemasfashion.com/ ?2fou_com deemasfashion.com/ **?iapolo_com** deemasfashion.com/ ?dur=2016

.htaccess not working on codeigniter subdomain & directory install

独自空忆成欢 提交于 2020-01-06 12:08:31
问题 I am trying to install CI under a directory which is also on a subdomain. So my base url would look like http://subdomain.domain.com/ci/ The following htaccess works fine on root of domain but not on directory, the browser says there is a redirect loop error. Here is my code: RewriteEngine on RewriteCond %{HTTP_HOST} !^sub\.domain\.com/ci/$ RewriteRule ^(.*)$ http://sub.domain.com/ci/$1 [L,R=301] RewriteCond $1 !^(index\.php|assets) RewriteRule ^(.*)$ /index.php?/$1 [L] I am not very skilled

.htaccess not working on codeigniter subdomain & directory install

[亡魂溺海] 提交于 2020-01-06 12:08:12
问题 I am trying to install CI under a directory which is also on a subdomain. So my base url would look like http://subdomain.domain.com/ci/ The following htaccess works fine on root of domain but not on directory, the browser says there is a redirect loop error. Here is my code: RewriteEngine on RewriteCond %{HTTP_HOST} !^sub\.domain\.com/ci/$ RewriteRule ^(.*)$ http://sub.domain.com/ci/$1 [L,R=301] RewriteCond $1 !^(index\.php|assets) RewriteRule ^(.*)$ /index.php?/$1 [L] I am not very skilled

How to rewrite URL based on domain in apache and add extra parameter?

爷,独闯天下 提交于 2020-01-06 11:05:15
问题 Basically, what I want to do is to rewrite all urls because we have many different languages. We have a server that hosts several domains. We have www.example.com, www.example.fr, www.example.de, www.anotherdomain.com, www.anotherdomain.de. What I want to do is to redirect all requests from example.xxx to www.example.com with extra url parameter lang=en. This should not affect other domains like www.anotherexample.com etc. This does not work: RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.de$

How to rewrite URL based on domain in apache and add extra parameter?

孤者浪人 提交于 2020-01-06 11:04:30
问题 Basically, what I want to do is to rewrite all urls because we have many different languages. We have a server that hosts several domains. We have www.example.com, www.example.fr, www.example.de, www.anotherdomain.com, www.anotherdomain.de. What I want to do is to redirect all requests from example.xxx to www.example.com with extra url parameter lang=en. This should not affect other domains like www.anotherexample.com etc. This does not work: RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.de$

escaping dot in Apache mod_rewrite

拟墨画扇 提交于 2020-01-06 09:31:50
问题 I have been using tuckey Apache mod-rewrite engine to rewrite urls. But I have problems in escaping dots to decorate URLS as shown below, www.example.com/hello.world -> www.example.com/derive.php Following rules are the ones I have written to do the above thing, RewriteRule ^/?(([A-Za-z0-9:-])+([.]*))$ /derive.php[L] ( RewriteRule ^/?(([A-Za-z0-9:-\.])+)$ /derive.php[L] is not allowed by tuckey) I think this question can be answered perfectly by people those who have used tuckey to decorate

Apache rewrite third directory depth to first directory depth

耗尽温柔 提交于 2020-01-06 08:40:10
问题 I have resources for two websites located here... localhost/index.php /* rewrite handler */ localhost/images/ localhost/scripts/ Then I have the two sites... localhost/site1/ localhost/site2/ I want to rewrite... localhost/site1/images/ localhost/site2/images/ localhost/site1/scripts/ localhost/site2/scripts/ ...to... localhost/images/site1/ localhost/images/site2/ localhost/scripts/site1/ localhost/scripts/site2/ Is there a way to make "site1" and "site2" a dynamic variable (so that I don't

Apache Reverse Proxy ReWrite

狂风中的少年 提交于 2020-01-06 08:39:48
问题 I have a apache instance setup to reverse proxy an internal application. I have this working using mod_proxy, but the end result is a lack of images and other content due to hard coded paths in the application itself. I think I have two options. Mod_Rewrite Mod_HTML The basic problem is this. External site: http://external.customer.com (Port 80) Internal site: http://internal.supplier.com:8080/testcustomer I need to get apache to proxy the connection, but it must use the full URL when talking

Apache Redirect when the page is SSL

旧巷老猫 提交于 2020-01-06 08:39:38
问题 I have a redirect from http://example.com to http://www.example.com. now i want this redirect to work when the user is in https protocol. meaning to redirect from https://example.com to https://www.example.com. is it possible? if not, how do i redirect https://example.com/page to http://example.com or http://www.example.com i hope i was clear 回答1: Redirecting from https://example.com to https://www.example.com works in the same way as redirecting from http://example.com to http://www.example