.htaccess

How to Change 302 Redirect to 301 Redirect in htaccess?

天大地大妈咪最大 提交于 2020-01-07 02:20:07
问题 Here's the code I have in my .htaccess: Options +FollowSymlinks RewriteEngine on RewriteBase /special/service RewriteRule ^(.+)$ http://clients.example.com/aff.php?aff=$1&p=service.php [R,NC] When I go the my redirect while running FireBug I'm seeing that it's actually a 302 redirect for some reason. What do I need to change to fix this? 回答1: Add a =301 in your flags: Options +FollowSymlinks RewriteEngine on RewriteBase /special/service RewriteRule ^(.+)$ http://clients.example.com/aff.php

htaccess URL routing for PHP MVC?

守給你的承諾、 提交于 2020-01-07 02:11:48
问题 I've been searching and have yet to find an article to help me. I'm very unfamiliar when it comes to the rewrite engine of htaccess files, and am currently developing a php mvc framework. Basically, from the root of the webserver, I need all page requests with their controllers / actions in the url to redirect to App/index.php So, for example site.com/Login/ would direct to the index.php, and the uri would obviously be parsed out with php to enact the login controller with passed post data.

Apache2 not working with routes PHP

Deadly 提交于 2020-01-07 01:22:34
问题 I am developing an app with PHP 7.0 and implementing routes with MVC. My root folder ('/') is the 'public' directory. When I access the address 'localhost' I am redirected to index.php with have the routes available. But when I try another url to access another route, like 'localhost/contact' the server doesn't find the entry and give this message: Not Found The requested URL /contact was not found on this server. I am pretty sure that the problem in on my server config (apache2 on linux mint

Apache2 not working with routes PHP

亡梦爱人 提交于 2020-01-07 01:21:20
问题 I am developing an app with PHP 7.0 and implementing routes with MVC. My root folder ('/') is the 'public' directory. When I access the address 'localhost' I am redirected to index.php with have the routes available. But when I try another url to access another route, like 'localhost/contact' the server doesn't find the entry and give this message: Not Found The requested URL /contact was not found on this server. I am pretty sure that the problem in on my server config (apache2 on linux mint

How can I get use outside information in url rewrites?

这一生的挚爱 提交于 2020-01-07 00:36:10
问题 Hopefully some of you .htaccess gurus can help me out with this one. I have never spent any time messing around with .htaccess before, so I'm a bit lost. Basically I want to take a link such as example.com/index.php?id=3 and convert it to http://example.com/pagename/ I can easily change it so that the link converts to http://example.com/directory/3 or something along those lines, but I don't really understand how people accomplish the change I'm looking for. I know that Wordpress does

Apache .htaccess mod_rewrite and clean urls

主宰稳场 提交于 2020-01-06 20:17:19
问题 Ok. So I'm building this site which is accessible through two different domains. So I can't use RewriteBase in my .htaccess. The rules (below) I use to work around this problem seem to work fine. However, when I use the below .htaccess settings on my local box with clean URLS (WAMP) it all works fine but the moment I use this on the live server (shared hosting LAMP) every page I navigate to displays the home page (the one under index I guess) even though the URL in the browser is clearly

404 return, when Setup .htaccess in fuel php

吃可爱长大的小学妹 提交于 2020-01-06 20:08:13
问题 i'm having problem when i want to install fule php in my pc, the problem is when i'm setup .htaccess i'm get 404 page not found, i have setup modrewrite in apache it's OK. this is my .htaccess file <IfModule mod_rewrite.c> RewriteEngine on RewriteBase /public RewriteRule ^(/)?$ index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> i'm place my code in directory htdocs/myproject. this is path of myproject

Codeigniter call Function in Controller without index.php

孤者浪人 提交于 2020-01-06 19:58:54
问题 I know there are so many posts concering that problem. I tried everything, but without success. I use xampp v3.2.2 on my windows 10 machine. In my htdocs I got a project called mysite. In there I have codeigniter 3.0.3. config.php $config['base_url'] = 'http://localhost/mysite/'; $config['index_page'] = ''; routes.php $route['default_controller'] = 'CI_home'; Controller CI_home.php: class CI_home extends CI_Controller{ function __construct() { parent::__construct(); } public function index(

.htaccess Not Working Properly In IE

偶尔善良 提交于 2020-01-06 19:41:47
问题 My .htaccess file is not working in IE, It works fine in FireFox and Chrome, but in IE images wont load, and links don't work correctly ether. The CSS works fine and all the PHP seams to be working aswell. I am pretty sure that it has something to do with me needing to pull 2 GET variables from the url, because it works fine when I only need to pull one variable. Anyway here is my code RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?([^/

How to get clean urls in yii2 like ``post/100``

我的梦境 提交于 2020-01-06 19:37:17
问题 I am quoting the guide: Depending on the urlManager configuration, the created URL may look like one of the following (or other format). And if the created URL is requested later, it will still be parsed back into the original route and query parameter value. /index.php?r=post/view&id=100 /index.php/post/100 /posts/100 I am interested in third option or second without index.php. But how can I get it ? I have .htaccess that is removing index.php ( I may need something for nginx, but do not