Showing posts with label htaccess html5mode rules. Show all posts
Showing posts with label htaccess html5mode rules. Show all posts

htaccess clean url php

htaccess clean url php

htaccess clean url php htaccess is the page url redirect and custom url is secure in web pages and passing data another page. follow us.

htaccess clean url php
htaccess clean url php

Redirect a dynamic redirect page

RewriteEngine On RewriteRule keyword/(.*).html keyword.php?page=$1

Page Redirect


Common variable sets

[A-Z] The variable can have uppercase letters
[a-z] The variable can have lowercase letters
[0-9] The variable can have numbers
([a-zA-Z0-9]+) The variable can have any of the above, and has no limit to the number of characters.

RewriteEngine On RewriteRule ^([a-zA-Z0-9]+)$ index.php?page=$1 RewriteRule ^([a-zA-Z0-9]+)/$ index.php?page=$1

Angularjs htaccess html5mode rules

Angularjs  htaccess html5mode Rules


htaccess html5mode rules
htaccess html5mode rules

htaccess html5mode Rules Angularjs Create a site is very looking and linking root changed so create a htaccess file. more example htaccess

I have an angular application with several routes,
site.com/
site.com/page
site.com/page/3
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]

    RewriteRule ^(.*) /index.html [NC,L]
First you have to do is turn on HTML5 mode in your Angluar main or module's config page.

Copy and Paste for the following Code and add your code.
angular.module('main', []).config(['$locationProvider', function($locationProvider) {  
  ...
  $locationProvider.html5Mode(true);
  ...
});

htacces page redirect and 404 page not found and index page redirect 301, and 302 temporary redirect and  permanent  redirect code follows

  RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested pattern is file and file doesn't exist, send 404
RewriteCond %{REQUEST_URI} ^(\/[a-z_\-\s0-9\.]+)+\.[a-zA-Z]{2,4}$
RewriteRule ^ - [L,R=404]

# otherwise use history router
RewriteRule ^ /index.html