N
N
Neutron2011-04-14 20:54:13
htaccess
Neutron, 2011-04-14 20:54:13

Redirect in .htaccess?

Comrades! Here such question arose.
There are a number of links like site.com/?1, site.com/?2, and so on.
All links that have a question mark "?" with any continuation, redirect to the main site.com page.
Thank you for your attention! :)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
F
Fastto, 2011-04-14
@Fastto

You are here - this is a description of modRewrite on Habré + in the footer of the topic, a link to the full Russian-language manual.

D
Dzuba, 2011-04-14
@Dzuba

Something like this:

RewriteRule ^(/\?.*)$ http://site.com/index.php?$1 [QSA,L]

R
Roman, 2011-04-14
@WNeZRoS

And what about redirection? Requests "/?.*" are sent to the main page, and for this it is enough to register DirectoryIndex index.html index.php index.htm index.py index.pl index.asp(Remove unnecessary, add what you need)
(You need mod_dir to work)

M
MT, 2011-04-14
@MTonly

You probably need an external redirect:
RewriteRule ^\/\? example.com/ [R=permanent]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question