This is my url http://www.example.com/demo/
what's wrong with my htaccess file? and how to slove it?
thank you in advance
#CHECK MOD REWRITE ON IN HOSTING SERVER
Options +FollowSymLinks
RewriteEngine on
#REWRITE URL FOR ALL PHP FILE TO HTML
RewriteBase /demo/
RewriteRule ^home\.html$ index.php?page=$1&lang=$2 [NC,L]
RewriteRule ^h([a-zA-Z0-9\-_\.\/]+)-([a-zA-Z0-9\-_\.\/]+)\.html$ index.php?page=$1&lang=$2 [NC,L]
RewriteRule ^p([a-zA-Z0-9\-_\.\/]+)-([a-zA-Z0-9\-_\.\/]+)\.html$ product.php?page=$1&lang=$2 [NC,L]
RewriteRule ^s([a-zA-Z0-9\-_\.\/]+)-([a-zA-Z0-9\-_\.\/]+)\.html$ service.php?page=$1&lang=$2 [NC,L]
RewriteRule ^a([a-zA-Z0-9\-_\.\/]+)-([a-zA-Z0-9\-_\.\/]+)\.html$ about.php?page=$1&lang=$2 [NC,L]
RewriteRule ^c([a-zA-Z0-9\-_\.\/]+)-([a-zA-Z0-9\-_\.\/]+)\.html$ contact.php?page=$1&lang=$2 [NC,L]
Related
The following .htaccess stopped working a couple of months ago and I cannot figure out why.
Options FollowSymLinks
RewriteEngine On
RewriteRule ^home*$ index.php [NC,L]
RewriteRule ^dashboard*$ index.php?view=dashboard [NC,L]
RewriteRule ^new-safar*$ index.php?view=new-safar [NC,L]
RewriteRule ^safars*$ index.php?view=safars [NC,L]
RewriteRule ^active-safars*$ index.php?view=active-safars [NC,L]
RewriteRule ^pre-registration*$ index.php?view=pre-registration [NC,L]
RewriteRule ^safars/kun-safar/([0-9]+)/edit-registration/([0-9]+) index.php?view=edit-kun-registration&safarid=$1&kunregid=$2 [NC,L]
RewriteRule ^safars/kun-safar/([0-9]+)/new-registration index.php?view=new-kun-registration&safarid=$1 [NC,L]
RewriteRule ^safars/kun-safar/([0-9]+)/new-pre-registration index.php?view=new-kun-preregistration&safarid=$1 [NC,L]
RewriteRule ^safars/kun-safar/([0-9]+) index.php?view=kun-safar&safarid=$1 [NC,L]
RewriteRule ^oops index.php?view=oops [NC,L]
RewriteRule ^register-yourself register-yourself.php [NC,L]
RewriteRule ^its-verification*$ its_verifications.php [NC,L]
For example, this url https://zadmin.colomboshabab.com/safars is giving a 404 Error.
The site is going through cloudflare but it was working earlier. It is hosted on a GoDaddy server.
I'm trying to rewrite my /index.php to /index, and my /register.php to /register, but it doesn't work!
This is my .htaccess:
RewriteEngine on
RewriteRule ^register/index$ register.php
RewriteRule ^index$ index.php
But... It isn't rewriting... Can someone tell me what I'm doing wrong?
RewriteEngine on
RewriteBase /
RewriteRule ^register/?$ register.php [NC,L]
RewriteRule ^index/?$ index.php [NC,L]
Adding Above code will make your the /register show /register .
I believe you're missing the preceding forward slashes:
RewriteEngine on
RewriteRule ^/register/index$ register.php
RewriteRule ^/index$ index.php
Check out the docs: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#ToC2 - all of the examples have preceding forward slashes.
I am using .htaccess file on my localhost and write this code:
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^about/?$ about.php [NC,L]
I have checked http.doc file everthing is fine. But its not working fine.
Thanks.
You can put the .htaccess on the www folder and place the content on it:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(.*)\.php [NC]
RewriteRule ^ /%1.html? [R=302,L]
RewriteRule ^abc/about\.html/?$ /abc/about.php [NC,L]
I have the following .htaccess file
Options +FollowSymLinks
RewriteEngine On
Options -Indexes
RewriteRule ^index/?$ index1.php [NC]
RewriteRule ^index/(.*\.html)/?$ index1.php?load=$1 [NC,L]
RewriteRule ^page/?$ page.php [NC]
RewriteRule ^page/([0-9]+)/([a-z]+)/([{a-z}{0-9}{\-\}]+)/?$ page.php?id=$1&cat=$2&title=$3 [NC,L]
and its work perfectly in my localhost. but not works in server,
the following .htaccess works good in my server
RewriteEngine on
RewriteRule testpage\.html http://www.google.com [R]
did i make any mistake? any help?
I'm trying to rewrite
http://www.example.com/directory/folder/*
to
http://www.example.com/directory/*
the htaccess file is in directory
this is my .htaccess file :
RewriteEngine on
RewriteBase /directory/
RewriteRule ^(.*)$ folder/$1 [L]
Any help would be much appreciated.
This is what I ended up doing :
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !(.*)folder
RewriteRule ^(.*)$ folder/$1 [L]
What about this?
RewriteEngine on
RewriteRule ^folder/(.*) /directory/$1 [L]
Or you can go without [L] or use [R] instead.