logo
down
shadow

htaccess rewrite all urls with a certain query to a parent directory


htaccess rewrite all urls with a certain query to a parent directory

By : user2949859
Date : November 17 2020, 04:28 AM
this will help You need to specify there is (maybe) something after mercedes-brands and suzuki-brands.
Here are your 2 rules modified
code :
RewriteRule ^cars/mercedes-brands(?:/.*)?$ /mercedes? [R=301,NE,NC,L]
RewriteRule ^motorbikes/suzuki-brands(?:/.*)?$ /suzuki? [R=301,NE,NC,L]


Share : facebook icon twitter icon
Htaccess Rewrite to PHP File in Parent Directory

Htaccess Rewrite to PHP File in Parent Directory


By : Jose Carlos Acosta B
Date : March 29 2020, 07:55 AM
hope this fix your issue What you're doing is essentially a multi-site application.
You should set the document root to the folder that contains the main index.php file. Then that should route the request to the required app by checking the HTTP host property in the $_SERVER superglobal, like for example:
code :
switch ($_SERVER['HTTP_HOST']) {
    case 'app1.com':
        include 'app1/index.php';
        // Do stuff
        break;

    case 'app2.com':
        include 'app2/index.php';
        // Do stuff
        break;
}
.htaccess rewrite multiple urls in the same directory

.htaccess rewrite multiple urls in the same directory


By : Greg Engle
Date : March 29 2020, 07:55 AM
it should still fix some issue You seem to be missing RewriteEngine On and also you need more than 1 rule to check whether matching .php file exists in /server/.
Place this rule in /server/.htaccess:
code :
RewriteEngine On

RewriteBase /server/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/server/$2\.php -f [NC]
RewriteRule ^([^/]+)/([^/]+)/?$ $2.php?server=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?server=$1 [L,QSA]
Apache .htaccess rewrite rule to redirect urls from sub-directory to parent directory

Apache .htaccess rewrite rule to redirect urls from sub-directory to parent directory


By : Emre
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I am looking for an Apache .htaccess rewrite rule to redirect urls from sub-directory to parent directory. , You can use this code in your DOCUMENT_ROOT/.htaccess file:
code :
RewriteEngine On

RewriteRule ^content/((?!admin|some-image\.jpg).+)$ /$1 [L,NC,R=302]
RedirectMatch 302 ^/content/((?!(admin|(.*\.(gif|jpeg|jpg|png|css|js|woff|ttf|svg|eot|GIF|JPEG|JPG‌​|PNG|CSS|JS|WOFF|TTF|SVG|EOT)))).+)$ /$1 
htaccess - Rewrite URLs with query parameter

htaccess - Rewrite URLs with query parameter


By : user3745113
Date : March 29 2020, 07:55 AM
should help you out I have the following rule to rewrite URLs which works for single word parameters. However, it doesn't work if there is a "-" in the variable. How can I modify this to accomplish this? , You need to fix your regex by using this rule in root .htaccess:
code :
Options -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^medications/([^/]+)/?$ medications/?drug=$1 [QSA,L,NC]
Rewrite urls in htaccess file - remove query string

Rewrite urls in htaccess file - remove query string


By : Zephyrous
Date : March 29 2020, 07:55 AM
With these it helps I am assuming you are using rewriterules in shop directory and index.php is handling the data then try with below.
code :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)$ index.php?s=$1 [L]
Related Posts Related Posts :
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org