The requested URL ......... was not found on this server - php

The home page of my wordpress website seems to be wroking correctly but if you click through to any of the other pages I get the following error message:
The requested URL /about was not found on this server.
There is following htaccess code in the permalink setting:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Related

removing index.php using htaccess prolem in magento

I have tried various option on my local wamp server for magento to remove index.php usng .htaccess
as per this stackoverflow link - link
I have tried various alternatives like
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
## RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
## RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule . /index.php [L]
</IfModule>
I have set the secure url to use on Frontend.
Also set the Use Web
Server Rewrites to yes. Cleared all the cache.
Now when I access a category, the url is shown without index.php. But then instead of the showing the category page I get the wamp server configuration page.
Note: If I insert the index.php between the domain and category the
page opens correctly

When i use domain and page name its redirecting to another folder

This is the URL of my website http://www.harimaumalaysia.my/ when i access through this url i can see my website with out error.
but when i use this URL http://www.harimaumalaysia.my/index.php Its redirecting to this URL www.harimaumalaysia.my/demo1.
how come this is happening while using index.php I changed my website url in database and permalinks but it didn't solved my problem can anyone help me out of this here is my ht-access file.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Set rewrite rule for index file like below.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(css|editor|editordocs|images|js|sysimgdocs)/.*$ - [PT]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>

Codeigniter: Loading default static page

I created a new "/blog" directory in Codeigniter 3. I want to install a new Wordpress blog into this new folder.
When I try to load new folder www.mysite.com/blog/, I get an error 404 message. Logs show:
ERROR - 2016-07-15 17:42:40 --> 404 Page Not Found: Blog/index
My .htaccess file content is:
AddDefaultCharset utf-8
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
How can I load (index.php) in my Blog directory by default, without typing index.php in browser's address? Please help me.
You have to create a .htaccess file in your subfolder "/blog".
The content could be like that :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

Wordpress permalink with no error 404 page

i am using wordpress permalink like url.com/article-name but i dont want errors 404 handled by my page - so redirected to the normal server error page.
I am using the following .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Can someone help me how i have to adjust the .htaccess code that a error is not redirected to the index.php. If i deleted the .htaccess any links redirects to the server error 404 page.
thank you
Just add this
ErrorDocument 404 /404.php
# where 404.php is your error page
According to this answer at https://wordpress.stackexchange.com/ you should use
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(robots\.txt|sitemap\.xml(\.gz)?)
RewriteCond %{REQUEST_FILENAME} \.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
RewriteRule .* - [L]
</IfModule>
Hope it helps!

Remove index.php from Codeigniter URL in subfolder with Wordpress in root

I'm having some issues with a Codeigniter app in a subfolder on my server along with a Wordpress install in the document root. If I hide the index.php of the Codeigniter URL with .htaccess
/codeigniter/.htaccess
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|user_guide|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
And get Wordpress to ignore /codeigniter with RewriteCond %{REQUEST_URI} !^/(codeigniter).*$
/.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/(codeigniter).*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Then navigate to www.mysite.com/codeigniter/my_controller/my_function, I get a 404 error No input file specified. I found here, that adding a ? after RewriteRule ^(.*)$ index.php solves the Codeiginiter 404 error.
/codeigniter/.htaccess
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
However I'm now getting a Wordpress 404 error, so it seems if I replace index.php with index.php? in /codeigniter/.htaccess, the Wordpress rewrite rule in /.htaccess, RewriteCond %{REQUEST_URI} !^/(codeigniter).*$ gets ignored. Is there a better way to handle this?
Thanks in advance!
The RewriteBase in the codeigniter directory should say /codeigniter/
RewriteBase /codeigniter
Otherwise the rewrite to index.php ends up going to wordpress' router.

Categories