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.
Related
Im trying to redirect to different pages. But it isn't working does anyone know how to fix it?
RewriteRule ^test assets/php/test/home.php [NC,L]
RewriteRule ^test/([0-9a-zA-Z]+) assets/php/test/menu.php?id=$1 [NC,L]
RewriteRule ^test/([0-9a-zA-Z]+)/([0-9a-zA-Z]+) assets/php/test/player.php?id=$1&sec=$2 [NC,L]
RewriteRule ^test/(.*)/(.*)$ assets/php/test/player.php?id=$1&sec=$2&type=dir [NC,L]
RewriteRule ^test/(.*)$ assets/php/test/testmenu.php?id=$1&type=dir [NC,L]
I´ve made some RewriteRules in my .htaccess and they all work if I call my Website from the Domain/URL of my server.
Now I wanted to point an external Domain to my subfolder on my server where my Website is located, but all RewriteRules aren´t working anymore. When I call the php-files everything is alright, but when I call my "beautiful" links, I wanted to create, then only error 404 is shown.
This is currently my .htaccess file:
ErrorDocument 401 /401.php
ErrorDocument 404 /404.php
RewriteEngine On
#redirect www request to the base domain
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#ignore existing files and directories
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]
# Check if query string exists
RewriteCond %{QUERY_STRING} ^$
# Check that the request is not for an existing file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^spielplan$ spielplan.php [NC,L]
RewriteRule ^rangliste$ rangliste.php [NC,L]
RewriteRule ^alletipps$ allbets.php [NC,L]
RewriteRule ^benutzerseite$ userpage.php [NC,L]
RewriteRule ^einstellungen$ usersettings.php [NC,L]
RewriteRule ^spiel/([0-9]+)/?$ spiel.php?id=$1 [NC,L]
RewriteRule ^user/([A-Za-z0-9-]+)/?$ user.php?name=$1 [NC,L]
RewriteRule ^([A-Za-z0-9-]+)/?$ $1.php [NC,L]
I found a solution.
Because I tried to map my domain to a subfolder, this subfolder needs to work like an DocumentRoot and not like a subfolder.
So I needed to add:
RewriteBase /
in my .htaccess
I have this so far, it works but when I use it as
http://www.example.com/blogs
it redirects to
http://www.example.com/blog.php
RewriteEngine On
DirectoryIndex website-design-example.php
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^blogs$ blog.php [NC,L]
RewriteRule ^blogs/$ blog.php [NC,L]
RewriteRule ^blogs/page/([0-9]+)$ /blog.php?page=$1 [NC,L]
RewriteRule ^blogs/([0-9]+)$ /blogPost.php?post=$1 [NC,L]
RewriteRule ^blogs/([0-9]+)/([a-zA-Z0-9-=\/]+)$ /blogPost.php?post=$1 [NC,L]
Can someone please guide me what am I doing wrong!
Thanks
my apache error log is full of this, I don't know what is wrong. This is my .htaccess file. Can somebody help me?
RewriteEngine on
# check that the request url is neither a file nor a directory
RewriteRule ^panel/?$ panel/ [NC,L]
RewriteRule ^([A-Za-z0-9-]+)/?$ app.php?slug=$1 [NC,L]
RewriteRule ^([A-Za-z0-9-]+)/index/([A-Za-z0-9-]+)/?$ app.php?slug=$1&index=$2 [NC,L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule \.(gif|jpg|png|bmp) /images/default.jpg [NC,L]
and I have another subdomain who redirects to this. And htaccess:
RewriteEngine on
RewriteRule ^(.*)$ http://ro.sughy.com/$1 [R=301,L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule \.(gif|jpg|png|bmp) /images/default.jpg [NC,L]
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]