mod-rewrite

how to fix htaccess error with multiple rewrite rule - ERR_TOO_MANY_REDIRECTS

走远了吗. 提交于 2019-12-13 04:28:11
问题 why this htaccess has error. it says "to many redirect" please help thanks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule .* index.php [L] RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteEngine on Options +FollowSymLinks RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ http://us.domain.com/ae_en/$1 [R=301,L] RewriteEngine on

Permanent Redirect with Parameters

此生再无相见时 提交于 2019-12-13 04:26:00
问题 Is there any way to permanently redirect a domain to another domain with a corresponding parameter? For example, somebody visits example.com , which permanently redirects to eg.com/?url=example . I've tried RewriteRule ^/?$ "https\:\/\/eg\.com\/?url=example" [R=301,L] , and, although it does indeed redirect to eg.com , it obviously ignores the parameters. Is there any way to do this with htaccess ? 回答1: Escape backslash before question mark. RewriteRule ^/?$ "https\:\/\/eg\.com\/\?url=example

Using htaccess to redirect http to https for Wordpress?

假装没事ソ 提交于 2019-12-13 04:04:07
问题 I've correctly enabled HTTPS redirect with the code below. After visiting one of the HTTPS pages, all other urls are inheriting the previous HTTPS. How can I force all other pages to HTTP? # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !on RewriteCond %{REQUEST_URI} ^(/checkout|/downloads|/all-products) RewriteRule ^(.*)$ https://websitename.com/$1 [R,L] RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f

Mod_rewrite isn't working as intended

喜夏-厌秋 提交于 2019-12-13 03:58:46
问题 I'm trying to rewrite a specific structured url to another structure. The original url is http://www.mywebsite.com/FF_Supersneaker_Black_Metallica_p/155-157.htm and I am trying to rewrite it to http://www.mywebsite.com/FF_Supersneaker_Black_Metallica.html essentially removing "_p/155-157.htm" and appending .html The htaccess file I am using to do this is <IfModule mod_rewrite.c> RewriteEngine On RewriteRule /(.*)/(.*)_p/[^/]*.htm$ /$1$2.html </IfModule> But it seems to be failing, Here is the

Restrict some url pattern in a apache redirect

旧城冷巷雨未停 提交于 2019-12-13 03:58:00
问题 I am writing a redirect to match any url of the patter /message/* here. RewriteRule ^/message/(.+)$ http://abet.in/message/$1 [NC,R=301,L] Now I want to modify it by not allowing some string pattern in url. RewriteCond to check /message/index.html in the url. 1. Check if the request url contains /message/index.html. 2. If the condition is not met then do a redirect. I tried the following methods. But I am not sure whether they are correct or not. RewriteCond %{THE_REQUEST} !^/message/index

Beginner's apache mod_rewrite assistance

我们两清 提交于 2019-12-13 03:55:51
问题 I am not really familiar with apache mod_rewrite . I have url parameters such as {domain}/index.php?blog=5 I simply want to make it {domain}/home.php?client=5 Is it a task as simple as it sounds and can anyone help? 回答1: The following might work, give it a try RewriteCond %{REQUEST_URI} ^/home.php [NC] RewriteCond %{QUERY_STRING} client=([0-9]+) [NC] RewriteRule (.*) http://%{REMOTE_HOST}/index.php?blog=%1 [L] 回答2: That seems pretty simple, to be honest — once you get your head into mod

mod_rewrite don't match on RewriteCond target - URL not found

别等时光非礼了梦想. 提交于 2019-12-13 03:38:21
问题 I am trying to rewrite all URIs inside directory /docs to /docs/index.php, using apaches mod_rewrite module. The URI doesn't exist as a directory structure, which I don't think is necessary when you are rewriting the URI to something that exit. I am getting the error: "The requested URL /docs/view/my_doc was not found on this server." These are my rewrite rules: RewriteEngine On RewriteCond %{REQUEST_URI} ^docs/([a-z]+)/([A-Za-z0-9_-]+)/?$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/docs/index.php

how to rewrite this simple url?

≯℡__Kan透↙ 提交于 2019-12-13 03:38:18
问题 how can i rewrite www.mysite.com/someURLhere into www.mysite.com/ping.php?url=someURLhere without mistaking local files, and directories as domains. so i dont want www.mysite.com/index.php www.mysite.com/admin/ to rewrite to www.mysite.com/ping.php?url=index.php www.mysite.com/ping.php?url=admin/ 回答1: <VirtualHost *:80> ServerName yoursite.com DocumentRoot /www/yoursite RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d

apache url rewrite problem

雨燕双飞 提交于 2019-12-13 03:36:45
问题 is it possible to rewrite the following URL: http://dev.aurora.com/problem/getproblems/fieldset/2?search=false&rows=20&page=1 to http://dev.aurora.com/problem/getproblems/fieldset/2/search/false/rows/20/page/1 Thanx in advance 回答1: Try these rules in the .htaccess file in your document root directory: RewriteRule ^problem/getproblems/fieldset/2/([^/]+)/([^/]+)/(.+)$ /problem/getproblems/fieldset/2/$3?$1=$2 [N,QSA] RewriteRule ^problem/getproblems/fieldset/2/([^/]+)/([^/]+)$ problem

How can I change the URL in the browser by htaccess?

守給你的承諾、 提交于 2019-12-13 03:36:20
问题 I want to change my url by htaccess from http://example.com/offer?search=something to http://example.com/offer/something The following htaccess works from http://example.com/offer/something but if I typing the http://example.com/offer?search=something then the url is not changing to http://example.com/offer/something. RewriteEngine On RewriteRule ^offer/([^/]*)$ /offer?search=$1 [L] Should I use "rewritecond"? What is the correct htaccess in this case? I try make it in Laravel framwork. I