Sponsored Content
Full Discussion: Rewrite wrong request
Top Forums Web Development Rewrite wrong request Post 302873799 by georgi58 on Thursday 14th of November 2013 03:24:15 AM
Old 11-14-2013
Quote:
Originally Posted by Scott
Something like:
Code:
RewriteRule (.*\.html).*\.html$ $1 [R=301,L]

http://htaccess.madewithlove.be

works great!
thank you very much.

---------- Post updated at 02:16 PM ---------- Previous update was at 02:13 PM ----------

Quote:
Originally Posted by Neo
You should find out why a bad URI is returning a 200 status code.

Perhaps you have some rewrite rules already that are effecting this?
you are right, but I could not find what causes this. Anyway, will leave it with the working solution from Scott.
thank you for your point.

---------- Post updated 11-14-13 at 10:24 AM ---------- Previous update was 11-13-13 at 02:16 PM ----------

Quote:
Originally Posted by Scott
Something like:
Code:
RewriteRule (.*\.html).*\.html$ $1 [R=301,L]

http://htaccess.madewithlove.be
Scott, please tell me how this line will look like no matter what characters are after the first ".html"

thank you one more time
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Apache Rewrite help!

I am trying to write RewriteRule on Apache_1.3.26 to get users web page from another server. for example if users tries to get web page on www.somedomain.com/~usersname it will get the web page from www.testdomain.com/~username without redirect and users will not be aware of any redirect... (1 Reply)
Discussion started by: hassan2
1 Replies

2. Shell Programming and Scripting

How do I rewrite to use a while instead of find?

for FILE in `find /home/Upload/*` Need to use a while instead to prevent errors when the file is emptied (4 Replies)
Discussion started by: goodmis
4 Replies

3. Shell Programming and Scripting

How to rewrite a line in a file

Hi Can anyone tell me how can rewrite a line in a file by using line number? I tried to use sed by failed to do so. For example HELLO 179.390 111.560 HOW TO DO WHAT TO DO to become HELLO 200 3000 HOW TO DO WHAT TO DO (21 Replies)
Discussion started by: c0384
21 Replies

4. Shell Programming and Scripting

grep help, how do i rewrite this

Thanks , franklin you method worked, i knew i had to use a while loop and getline in there just didnt know the proper order :) Hi everyone, im trying to make the following command line shorter by introducing a script that join up all the grep commands ./new1a < numbers.txt | grep -i -v '^a '... (5 Replies)
Discussion started by: weezybaby
5 Replies

5. UNIX for Dummies Questions & Answers

rewrite date

I'm looking to have function that takes the present month and rewrites it into this form: _06_ (june), _09_ (september), and so on.. I would like this to be a my $this_month=code that rewrites date function because I would like to be a able to call it multiple times in the script by writing... (5 Replies)
Discussion started by: marringi
5 Replies

6. Web Development

Need help with rewrite rule

Hi, I hosted my site on Apache web server. I wanted to redirect all the users request to a HTML page(maintenance page). I used the below rewrite rule to do ths same. RewriteEngine on RewriteRule .* /maintenance.html The maintenance.html page contains an image. When ever I try to... (2 Replies)
Discussion started by: BSrikanthB
2 Replies

7. Shell Programming and Scripting

Why result is wrong here ? whether break statement is wrong ?

Hi ! all I am just trying to check range in my datafile pls tell me why its resulting wrong admin@IEEE:~/Desktop$ cat test.txt 0 28.4 5 28.4 10 28.4 15 28.5 20 28.5 25 28.6 30 28.6 35 28.7 40 28.7 45 28.7 50 28.8 55 28.8 60 28.8 65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

8. Linux

Rewrite proxypass

Hi, I have a Apache 2.0 web server. When a users comes in to sitea.com a check is applied if the path ends with *t*, the user hits a rewrite rule that adds an environment variable called x is hit with a proxypass. This has worked successfully in the past, but recently I added another rewrite... (0 Replies)
Discussion started by: 3junior
0 Replies
HTTEST(1)							   User Commands							 HTTEST(1)

NAME
httest - test HTTP driven application SYNOPSIS
httest [OPTIONS] scripts DESCRIPTION
httest is a script based tool for testing and benchmarking web applications, web servers, proxy servers and web browsers. httest can emu- late clients and servers in the same test script, very useful for testing proxys. OPTIONS
-V --version Print version number and exit -h --help Display usage information (this message) -n --suppress do no print start and OK|FAILED -s --silent silent mode -e --error log level error -w --warn log level warn -i --info log level info -d --debug log level debug for script debugging -p --debug-system log level debug-system to log more details -L --list-commands List all available script commands -C --help-command Print help for specific command -t --duration Print test duration -T --timestamp Time stamp on every run -S --shell Shell mode -S --shell Shell mode -D --define Define variables EXAMPLES
httest script.htt httest -Ts script.htt SCRIPTS
httest is script based. The following script examples can be but into a scripte i.e. sample.htt and can be called like httest sample.htt SIMPLE SCRIPT
Get a page and do expect return code 200 OK. CLIENT _REQ www.google.ch 80 __GET /search?q=apache HTTP/1.1 __Host: www.google.ch __ _EXPECT headers "HTTP/1.1 200 OK" _WAIT END CUT AND PAST SCRIPT
Cut and past from a HTTP stream, i.e we cut the apache host to access it in the second request. CLIENT _REQ www.google.ch 80 __GET /search?q=apache HTTP/1.1 __Host: www.google.ch __ _MATCH body '<a href="http://([^/]*)/" class=l>Welcome! - The <em>Apache</em> HTTP Server Project' APACHE_HOST _WAIT _REQ $APACHE_HOST 80 __GET / HTTP/1.1 __Host: $APACHE_HOST __ _WAIT END CLIENT SERVER SCRIPT
We can hold client and server in the same host. Actually multiple client and multiple server. Very useful to test forward or reverse prox- ies. Or a webapplication which communicat itself with third party servers i.e. mail server. This is a very basic selfcontained test you can run on any maschine. CLIENT _REQ localhost 8080 __GET /foo HTTP/1.1 __Host: localhost __ _WAIT END SERVER 8080 _RES _EXPECT "/foo" _WAIT __HTTP/1.1 200 OK __Content-Length: AUTO __ __Hello World END SSL SCRIPT
Of course SSL do also work with httest, just put "SSL:" before port. CLIENT _REQ localhost SSL:8080 __GET /foo HTTP/1.1 __Host: localhost __ _WAIT END SERVER SSL:8080 _RES _EXPECT "/foo" _WAIT __HTTP/1.1 200 OK __Content-Length: AUTO __ __Hello World END AUTHOR
Written by Christian Liesch REPORTING BUGS
Report bugs to http://sourceforge.net/projects/htt COPYRIGHT
Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. httest 2.2.6 June 2012 HTTEST(1)
All times are GMT -4. The time now is 08:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy