Laravel 4 htaccess redirect loop 2

moin khan

this is the .htaccess file now

 <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
  </IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

But i want to change this file as when request come from blog.domain.com it redirect to the /blog folder and other file to the index.php

Amit Verma

Try this :

RewriteEngine On
#Redirecting blog.example.com to blog folder
RewriteCond %{HTTP_HOST} ^blog.example.com$ [NC]
RewriteRule ^(.*)/?$ /blog/$1 [L,NC] 

#Redirect other requests to index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /index.php [L,NC]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related