mod-rewrite

Redirecting http traffic to https in Apache without using mod_rewrite

一笑奈何 提交于 2019-12-13 08:08:33
问题 I am trying a pretty simple thing that I would normally do using a RewriteRule (and which works perfectly when I do). My goal: Force certain (not all) URLs to use the https protocol. Caveats: Apache is behind a crypto-offloader. We would like a single virtual host that deals with both the unencrypted and the decrypted traffic. The offloader forwards all traffic to the same port and sets the X-Forwarded-Proto header. (It also sets the new Forwarded header for future compatibility, but I will

cannot find mod_rewrite for codeigniter [closed]

不打扰是莪最后的温柔 提交于 2019-12-13 07:52:22
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I cannot find the mod_rewrite in the codeigniter wiki anymore? where did it go? I tried looking at this link but its not in here anymore. 回答1: mod_rewrite is part of apache web server it not part of codeigniter

Wildcard subdomain mod-rewrite

元气小坏坏 提交于 2019-12-13 07:51:12
问题 I have a wildcard subdomain *.domain.com assigned to public_html/. I want to make the directory www.domain.com/folder1/index.php?name=rock to rock.domain.com . As for another one, I want to make www.domain.com/folder1/folder2/index.php?id=5 to 5.domain.com Are there any way to do this? I'm a beginner in mod-rewrite. Really appreciate your help. Thanks Additional Information I need both of them. They will have different variables. For example, /folder1/index.php is based on state name(?state

htaccess rewriting to include file in every folder

邮差的信 提交于 2019-12-13 07:48:37
问题 Is there a way I could use htaccess' url rewriting feature to look like there's a file in let's say the /public/some/folder when it's actually in /public . For example I have index.php in root folder and I want it to be like that when I access index.php then it could also behave as its in all the folders and subfolders too When I execute index.php then it will also execute in all folders and subfolders too Update Please understand my question by the example below index.php is in root and I

.htaccess trouble with hiding file extension and forcing trailing slash

情到浓时终转凉″ 提交于 2019-12-13 07:47:11
问题 When I type domain.com/page.php it doesn't automatically change to domain.com/page/. Also, for the pages in subdirectories, if I follow a link to domain.com/sub/1/ everything is fine, but if I type it in the browser it redirects to domain.com/1/ This is what i have in .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^/]+)/$ $1.php # Forces a trailing slash to be added RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST

Change the URL to URL with HTTPS

*爱你&永不变心* 提交于 2019-12-13 07:43:20
问题 I have my .htacces on my server and it looks like so: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] But when I type example.com in my browser it doesn't redirect to https://example.com . How can I do that? 回答1: It would seem it was just the spelling of .htaccess (filename) that was the problem. This has two s , not one, as stated in the question. Bit of an aside... the name of this file (per-directory Apache config filename) can be changed in

htaccess 301 obsolete query string to homepage

安稳与你 提交于 2019-12-13 07:42:52
问题 I need to redirect (remove completely from URL) the old query string i used but which is now obsolete for my site. So i need from http://example.com/?_pu=true to get users redirected to http://example.com/ I need just 301 redirect to remove it from URL so users won't share that URL. Problem is the query string (?) i think cuz I have this code which doesnt work: Redirect 301 /?_pu=true http://www.example.com I also tried this: RewriteCond %{QUERY_STRING} ^pu=(.+)$ [NC] RewriteRule ^index.php$

Rewrite escaped hashtag # %23

一笑奈何 提交于 2019-12-13 07:40:33
问题 I recently noticed some incoming 404 error hits from URLs with their hashtag escaped. Correct URL structure: http://example.org/#!/thepage or /index.html#!/thepage Escaped/ Incorrect URL: http://example.org/%23!/thepage I tried the following .htaccess rule with little success: RewriteEngine on RewriteRule ^%23!/(.*)$ /index.html#!/$1 [NE] 回答1: Thanks to this answer which pointed me into the right direction: https://webmasters.stackexchange.com/a/76059 Here is the rule that worked for me

Working with Slim Framework and htaccess

▼魔方 西西 提交于 2019-12-13 07:40:08
问题 I have the following code: RewriteEngine On # If you need to use the `RewriteBase` directive, it should be the # absolute physical path to the directory that contains this htaccess file. # # RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^category/(.*)$ searchPage.php?crs_category=$1 [NC,QSA] RewriteRule ^ index.php [QSA,L] Now the way Slim Framework works is that all requests are redirected to index.php , where index.php route the requested

rewrite 301 replace domain name with a new domain name

本秂侑毒 提交于 2019-12-13 07:32:33
问题 I need some help on mod rewrite 301 , to redirect my old website address to the new address , here is my scenario ive www.domain1.com/page1/ want to be redirect to domain2.com/page1/ ive to replace all request goes to domain1 with domain2 and keep the page after .com so watever was after .com should be the same just replace domain1 with domain2 . anyone can help me with this Regards 回答1: You may want to make sure UseCanonicalName is off, lest apache replace hostnames with the site's