mod-rewrite

stop requests for index.php+++++++++

眉间皱痕 提交于 2021-01-28 06:47:14
问题 I am trying to redirect users requesting a root index.php I was using Redirect 301 /index.php http://mywebsite/junk/index.html while this works ok IF people only request index.php, but now i am getting many requests for index.php++++ (sometimes more ++ than others) is there something I can add to Redirect 301 /index.php to include redirecting index.php+++ ? 回答1: You can use mod_rewrite for regex capabilities and finer control: RewriteEngine On RewriteRule ^index\.php http://mywebsite/junk

mod rewrite - handle url request without php extension

谁说胖子不能爱 提交于 2021-01-28 06:36:39
问题 i want server requests without .php ending to be handled like they had .php. for example http://example.com/exampleSite is requested by the user. How can i use a rewrite rule to handle it like it was requested as http://example.com/exampleSite.php? I do not want to use .htaccess (as it is recommended to put rewrite rules into a directory block inside the apache vhost config. And i only want this to affect my php files in the root directory. The following config unfortunately does not work.

htaccess wordpress rewriterule not working 404 error

霸气de小男生 提交于 2021-01-28 04:51:28
问题 I'm attempting to make a rewriterule for a page to load the content of another one and show the proper information. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^index\.php/file/(.*)$ index.php/file/?value=$1 [L,QSA] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> When i put my url it shows me a 404 error

Force HTTPS on my rewrite and rule .htaccess file

ぐ巨炮叔叔 提交于 2021-01-28 02:32:27
问题 I would like to force https on my site but that it is compatible with the current rule of my .htaccess Here is my htaccess file at the moment : RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] Thanks 回答1: Could you please try following, where you need to look for condition if variable %{HTTPS} is on or not, add this condition with already existing condition. Also please don't mix it with already existing URL as it may get expose to client

mod_rewrite: Trailing slash on URL with two GET variables

坚强是说给别人听的谎言 提交于 2021-01-28 00:04:41
问题 I'm in the process of overhauling one of my projects, a web based booking system, but I'm having a bit of an issue with my htaccess file. The old system was pretty standard, with .php scripts in the route of the website, I had a rule hiding my extensions, and I resultantly had a URL like /viewinvoce?ID=1. I've been trying to find out how to rewrite this URL so it looks a lot neater - in the format /viewinvoice/1, and I'm getting there, but I have a slight problem... The URL /test works - it

Htaccess - Rewrite and Redirect URL with PHP GET variable

此生再无相见时 提交于 2021-01-27 21:10:35
问题 I am trying to both rewrite and redirect this URL: https://www.domain.com/video-lessons-page.php?item=stocks to go to this URL: https://www.domain.com/stocks-video-lessons Here is the code I'm currently working with: RewriteCond %{QUERY_STRING} ^item=([^&]+) RewriteRule ^/?video-lessons-page\.php$ https://www.domain.com/%1-video-lessons? [R=301,L] RewriteRule ^(stocks|finance|accounting)-video-lessons$ video-lessons-page.php?item=$1 [NC,L] Unfortunately with the above code I'm having issues.

RewriteRule for unknown directory

痞子三分冷 提交于 2021-01-27 13:19:22
问题 So I'm trying to get a mod_rewrite rule to redirect requests to a php-script with an .htaccess file. The thing is, I want it to work regardless of where I put the project on a webserver (the .htaccess file and the php-script are always in the same folder). The rewrite itself is very simple. If the script and the .htacess are in the directory /path/to/project and the user visits: /path/to/project/somestring it should be rewritten to: /path/to/project/index.php?t=somestring This should work for

.htaccess use parameter from request_uri and query_string

我是研究僧i 提交于 2021-01-27 11:50:44
问题 I try to get call a page with this structure: /page/my-selection.html?p=1 /page/my-selection2.html?p=3 /page/my-selection3.html?p=6 where my-selection, my-selection2, ... is a database key and p the pagination. I want to redirect this on one single page, which does all the magic, but how i can use mod_rewrite to use the variables from both RewriteCond's? I tried it this way, bit it doesn't work: RewriteCond %{REQUEST_URI} page/(.*)\.html [NC] RewriteCond %{QUERY_STRING} ^p=(.*) RewriteRule

.htaccess use parameter from request_uri and query_string

二次信任 提交于 2021-01-27 11:48:04
问题 I try to get call a page with this structure: /page/my-selection.html?p=1 /page/my-selection2.html?p=3 /page/my-selection3.html?p=6 where my-selection, my-selection2, ... is a database key and p the pagination. I want to redirect this on one single page, which does all the magic, but how i can use mod_rewrite to use the variables from both RewriteCond's? I tried it this way, bit it doesn't work: RewriteCond %{REQUEST_URI} page/(.*)\.html [NC] RewriteCond %{QUERY_STRING} ^p=(.*) RewriteRule

executing commands in AWS ebextensions

允我心安 提交于 2021-01-27 07:25:45
问题 I receive the following error while trying to upload my instance in aws elasticbeanstalk: The configuration file .ebextensions/setup.config in application version t5 contains invalid YAML or JSON. YAML exception: while scanning a quoted scalar in "<reader>", line 3, column 18: command: "aws s3 cp s3:elasticbeanstalk-u ... ^ found unexpected end of stream in "<reader>", line 5, column 1: ^ , JSON exception: Unexpected character (c) at position 0.. Update the configuration file. Below is what