Answer the question
In order to leave comments, you need to log in
How to write rewrites for an Instagram-like service?
Hey! the essence is the following:
mod_rewrite.
http://site.com/
& http://site.com
should redirect to site.com/index.php
BUT http://site.com/aeiu3bx
(i.e. ([A-Za-z0-9#]+)
) should redirect to site.com/index.php?param=$1
There are rules like this:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?param=$1 [L]
site.com/o3unxo3
-> site.com/index.php?param=o3unxo3
, site.com/
turns into some kind of mess of paths like site.com/home/var/www/site.com/site.com/
Answer the question
In order to leave comments, you need to log in
those rewrites that you showed here work great
and for the voiced tasks of this code, a
sausage with a root request is enough - this is the code that you don’t show us,
so you need to throw out the rest of the code responsible for rewrites and redirects, and everything will work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question