.htaccess

Codeigniter 4: Cannot access the page with apache mode_rewrite

家住魔仙堡 提交于 2021-02-20 03:40:53
问题 I installed Codeigniter 4.0.0.rc3 on my local computer using Wampserver and created a 'people' controller. I can access the page using this address: http://127.0.0.1/election/index.php/people But not without 'index.php': http://127.0.0.1/election/people And this is the error: The requested URL /Projects/Web/election/public/index.php/people was not found on this server. .htaccess is in the public directory and is working because the error shows index.php in the path. This is my htaccess: #

How to implement this .htaccess in firebase?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-19 07:32:27
问题 I have this .htaccess for a PWA Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.html [QSA,L] I want to migrate the app to firebase, basically what it does is let's say I shared this link example.com/pwa/giftLink He gets redirected to PWA example.com/pwa And the PWA redirects him to giftLink . I don't want to do it via code, I prefer doing it via firebase.json 回答1: In Firebase Hosting rewrites, the equivalent would be: "hosting": { // ... // Add the

Trailing %20 white space in URLs producing 404 errors in Codeigniter

老子叫甜甜 提交于 2021-02-19 07:16:23
问题 Our URLs with a URL encoded trailing white space ( %20 ) are producing a 404 error. The application is run on Codeigniter on Apache. /directory/page%20 will return a 404 error /directory/page will return a 200 OK How can I route all URLs with a trailing %20 to the intended URL? 回答1: The problem is that some third party websites are linking to us with trailing white space in the HREF In that case you can add something like the following at the top of your .htaccess file to redirect

$.post to Codeigniter Controller/Method 404 Page Not Found

为君一笑 提交于 2021-02-19 06:46:07
问题 I have developed a Codeigniter prototype application and hosted with Godaddy.com during the development phase for testing purposes without issue. This application uses a combination of javascript, jquery, HTML5, CSS and PHP (Codeigniter Framework). This week I have transferred the application to the clients server and have had many configuration issues but finally hit a wall. The client set up a fresh install on a new Linux/Apache2 server with PHP5. mod_rewrite is enabled and allowoverride is

htaccess - internet server error 500 on XAMPP [closed]

允我心安 提交于 2021-02-19 04:59:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . Improve this question I am trying to run script on XAMPP but get "internet server error 500". Its fine when running on the live server. I assume this is a .htaccess error. The htaccess code is below: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L] </IfModule> I

404 issue in two htaccess in root domain and subfoler

旧城冷巷雨未停 提交于 2021-02-19 03:58:21
问题 My root domain htaccess: Options +FollowSymLinks RewriteEngine on RewriteBase / ErrorDocument 404 /404.php RewriteCond %{`HTTP_HOST`} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ `https://%1/$1` [R=301,L] RewriteCond %{HTTPS} !on RewriteRule (.*) `https://%{HTTP_HOST}%{REQUEST_URI}` [R=301,L] In my subfolder htaccess: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} `^(www\.example\.com)?$` RewriteRule ^(.*)$ `https://example.com/subfolder/$1` [R=301,L] Wehn I type in example.com/any-wrong-url

AddType application/x-httpd-php .html

感情迁移 提交于 2021-02-19 03:42:37
问题 I am moving from a server with PHP 5 to a new server with PHP 7, and I am having issues to tell Apache to parse .html as PHP scripts. In my .htaccess file I have this line working correctly on my current server with PHP 5: AddType application/x-httpd-php .html But on the new server, that directive makes any .html file being downloaded instead than executed as a PHP script. I know that on the current server with PHP 5 installed, PHP is configured with API set as "Apache 2.0 Handler" whereas on

Redirect Website Homepage Only

社会主义新天地 提交于 2021-02-18 22:52:18
问题 I have two different websites that are hosted on different servers. I would like to redirect the homepage of the old site (www.oldsite.com.au) to the homepage of the new site (newsite.com.au). However, I do not want any pages within the old site (www.oldsite.com.au/page) to redirect to the new one (newsite.com.au/page). So, www.oldsite.com.au must redirect to newsite.com.au, but any other pages or files within the old site must not redirect. All the .htaccess ideas I've tried just redirect

stop .htaccess mod_rewrite in a directory

守給你的承諾、 提交于 2021-02-18 21:57:37
问题 I have copied some code (for Wordpress permalinks) into my .htaccess file in the root directory. All has been working fine. This is the code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> I've now created a new directory that I want to password protect using .htaccess. I've set that up (using a ht.access file in the directory I want to

What are the .htaccess elements REQUEST_FILENAME and THE_REQUEST?

情到浓时终转凉″ 提交于 2021-02-18 20:09:19
问题 What is returned by %{REQUEST_FILENAME} and %{THE_REQUEST}? I was just checking over our .htaccess file and it dawned on me, I have very little knowledge of this. The code below uses both. It works I just want understand it. #remove / at the end of URL RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)/$ /$1 [L,R=301] #remove /index.php at the end of URL RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ /$1 [R=301,L] Cheers, Mark 回答1: