mod-rewrite

1&1 Windows hosting Server web.config URL rewrite issues

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 21:43:07
问题 I am facing an issue related to URL rewrite in windows server hosted by 1&1. i am trying to rewrite the urls using web.config file but it's not working at all giving me the error or 500.19 Error Summary HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x8007000d Config Error Config File \?\E:

Remove trailing slash with mod_rewrite

廉价感情. 提交于 2019-12-21 21:37:49
问题 I've tried every single example I could find, they all produce an internal server error. I have these rules set up (this works, no error): Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f RewriteRule ^((/?[^/]+)+)/?$ ?q=$1 [L] So if it's not an existing file or an existing directory with an index.php we redirect. For instance, http://domain.com/foo/bar becomes http://domain.com/?q=foo/bar Thing is, I want the trailing

rewrite and url decoding

霸气de小男生 提交于 2019-12-21 20:57:44
问题 It seems a site is linking to mine in a bad way. From google webmaster tools I see some 404 errors domain.com/file.php?id=1 (404) Not found (Date) This url works ok but because of browser page decoding, the real (404) url is domain.com/file.php%3Fid%3D1 (this is what my browser displays in the url input when I click on google url) My first try was RewriteRule ^(.*)\%3F(.*)$ $1?$2 [R=301, L] to change %3F to ' ? ' but it does not work. It is confusing what is real and what is en/decoded.

Mapping a secondary domain to a subdirectory using mod_rewrite

主宰稳场 提交于 2019-12-21 20:49:40
问题 I am looking to map a secondary domain to a subfolder on my document root. For example, if requests to the domain www.example.com map to my DocumentToot, then requests to www.exampletwo.com go to /sites/files/ . I am unable to accomplish a redirect from www.exampletwo.com/index.html to www.exampletwo.com/sites/files/index.html while making the URL still display www.exampletwo.com/index.html . Any ideas? 回答1: I believe you're looking for something like this: RewriteCond %{HTTP_HOST} ^(www\.)

How can I use “mod rewrite” to redirect a folder path to a subdomain, but without a browser redirect?

烈酒焚心 提交于 2019-12-21 20:45:16
问题 I have a file that I want to redirect to a subdomain using mod_rewrite. For example, I would like to redirect the request for http://www.mydomain.com/xyz to the subdomain xyz.example.com I don't want to send a redirect to the browser though (so it doesn't know the page is different). BTW. xyz is a CNAME record, pointing to www.otherdomain.com. Another example, just to clarify. If http://www.mydomain.com/xyz/something is entered into the browser, I want Apache to return the contents of http:/

How would I write an if - elseif - elseif conditional block in an .htaccess file?

≯℡__Kan透↙ 提交于 2019-12-21 20:44:49
问题 This is what I want to accomplish in pseudocode: if server.host equals 'productionsite.com' then RewriteBase / else if server.host equals 'stagingsite.com' then RewriteBase /staging/mysite else if server.host equals 'localhost' or server.host equals '127.0.0.1' then Rewrite /dev/mysite However, this is what I actually have so far which doesn't seem to work as I expect: RewriteCond %{HTTP_HOST} =productionsite.com RewriteBase / RewriteCond %{HTTP_HOST} =stagingsite.com RewriteBase /staging

6 .htaccess Rewrites: Remove index.html, Remove .html, Force non-www, Force Trailing Slash

只谈情不闲聊 提交于 2019-12-21 20:25:10
问题 i've to give some information about my website Environment i have static webpage in the root. Wordpress installed in sub-dictionary www.domain.com/blog/ I have two .htaccess , one in the root and one in the wordpress folder. i want to www to non on all URLs < below code DID it :) Remove index.html from url < below code DID it :) Remove all .html extension / Re-direct 301 to url without .html extension < below code DID it :) Add trailing slash to the static webpages / Re-direct 301 from non

PHP all GET parameters with mod_rewrite

故事扮演 提交于 2019-12-21 17:48:20
问题 I am designing my application. And I should make the next things. All GET parameters (?var=value) with help of mod_rewrite should be transform to the /var/value. How can I do this? I have only 1 .php file (index.php), because I am usign the FrontController pattern. Can you help me with this mod_rewrite rules? Sorry for my english. Thank you in advance. 回答1: I do something like this on sites that use 'seo-friendly' URLs. In .htaccess: Options +FollowSymLinks RewriteEngine on RewriteCond %

How to use apache's mod_rewrite rewriterule without changing relative paths

寵の児 提交于 2019-12-21 17:41:49
问题 I've the following rewrite rule in .htaccess: RewriteRule ^groups/([^/\.]+)/?$ groupdetail.php?gname=$1 [L,NC] This takes something like www.example.com/groups/groupname and calls www.example/groupdetail.php?gname=groupname. And it works just fine. But all the relative links on groupdetail.php use groups/ as the relative path, and I don't want them to. How do I avoid this? For example, when a user clicks on a link <a href="link.php"> on groupdetail.php?gname=groupname, he's taken to www

.htaccess mod_rewrite url with multiple optional parameters

拥有回忆 提交于 2019-12-21 17:31:30
问题 I'm pretty new to this mod_rewrite business but I'd like to have a rule that allows me to accomplish the following: localhost/module_name/ -> localhost/index.php?module=module_name localhost/module_name/module_action -> localhost/index.php?module=module_name&action=module_action localhost/module_name/module_action/parm1 -> localhost/index.php?module=module_name&action=module_action&parm_1=parm1 localhost/module_name/module_action/parm1/parm2 -> localhost/index.php?module=module_name&action