I have laravel website and there is blog folder which contain wordpress blog. In my htaccess I want some path that allow to open otherwise redirect on home. So my post preview link also redirect on home page. I want to stop it. Preview link is like
https://www.test.com/?p=16286. I want to redirect on particular page. Below is my htaccess code
RewriteEngine on
RewriteCond %{REQUEST_URI} !/my-form
RewriteCond %{REQUEST_URI} !/save_subscribe_user
RewriteCond %{REQUEST_URI} !/demo
RewriteCond %{REQUEST_URI} !/xamarin-app-development
RewriteCond %{REQUEST_URI} !/xamarin-app-development-inner
RewriteCond %{REQUEST_URI} !/web-and-mobile-app-development
RewriteCond $1 !^(blog|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ blog/$1 [L,QSA]
## EXPIRES CACHING ##
AddHandler application/x-httpd-php .js
## EXPIRES CACHING ##
Options -MultiViews -Indexes
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
#This line added to allow blog in URL and allow routing through Laravel
RewriteCond %{REQUEST_URI} !^/blog/
#Blog post preview URL
RewriteCond %{QUERY_STRING} ^p=([0-9]*)
RewriteRule ^
http://www.test.com/?p=%1&preview=true [R=301,L]
Run code snippetExpand snippet
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)