Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Rewrite wrong request


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Rewrite wrong request

Hi everybody,

In my web site I have several index pages in different languages in the following format

Code:
http://www.mysite.com/lang_index.html

Two days ago I noticed increased, many times. Google bot activity on my site and when I checked my log file I found that all pages crawled were wrong web addresses: to the above index were added existing files from my site like

Code:
/folder1/folder2/file.html

So, the strings looked like

Code:
http://www.mysite.com/lang_index.html/folder1/folder2/file.html

And surprisingly all they returned code "200".

My question is: is there any way to rewrite such requests to the first ".html" found in the string.

Your help is greatly appreciated.
# 3  
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?
This User Gave Thanks to Neo For This Post:
# 4  
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
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Why result is wrong here ? whether break statement is wrong ?
Akshay Hegde
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...... Shell Programming and Scripting
2
Shell Programming and Scripting
How do I rewrite to use a while instead of find?
goodmis
for FILE in `find /home/Upload/*` Need to use a while instead to prevent errors when the file is emptied... Shell Programming and Scripting
4
Shell Programming and Scripting
Apache Rewrite help!
hassan2
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...... UNIX for Advanced & Expert Users
1
UNIX for Advanced & Expert Users

Featured Tech Videos