I need to update my .htaccess file for URL rewriting. Even this post did not help. I need to divert as following but it does not work!
First requirement
(Just alphabet - case insensitive - accept space)
domain.com/Acco unting > domain.com/edit.jsp?kazem=Acco unting&oto=1&sab=
domain.com/acco unting > domain.com/edit.jsp?kazem=acco unting&oto=1&sab=
domain.com/Accounting > domain.com/edit.jsp?kazem=Accounting&oto=1&sab=
domain.com/accounting > domain.com/edit.jsp?kazem=accounting&oto=1&sab=
Second requirement
(First part just alphabet,accept space - Second part alphabet and number, accept space)
domain.com/Accounting/city 2222 > domain.com/edit.jsp?kazem=Accounting&oto=1&sab=city 2222
domain.com/Accou nting/city 2222 > domain.com/edit.jsp?kazem=Accou nting&oto=1&sab=city 2222
My .htaccess is as following
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
</IfModule>
#Options +FollowSymLinks
#IndexIgnore */*
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule ^(.*)/(.*[0-9]+)$ /edit.jsp?kazem$1&oto=1&sab=$2 [L]
</ifModule>
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
#RewriteRule ^(.[a-zA-Z]+)$ /edit.jsp?kazem=$1&oto=1&sab= [L]
RewriteRule "^([a-z]+( [a-z]+)?)/?$" /edit.jsp?kazem=$1&oto=1&sab= [L]
</ifModule>
IndexIgnore *
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
# Header set Access-Control-Allow-Credentials true
Header add Access-Control-Allow-Headers "*,origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "GET, POST, DELETE, OPTIONS"
</IfModule>
DirectoryIndex index.html index.php