Friendly URLs cannot load ABS_PATH in OSClass - php

I have a friendly URL module redirecting my index page to a search page. If I write index.php with my link then it redirects me to index page. If I try to access registration page it gives me error
ABS_PATH is not loaded. Direct access is not allowed.
If I try to access any category it gives me an error such as
Not Found
The requested URL /for-sale_1/toys-games-hobbies_1/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I have checked my error log it is giving me this error
<IfModule mod_rewrite.c> is without </Ifmodule>
Works great on the local server, but not on the remove live using Apache.
Category links work on the live site but when I click to register or login or publish link it gives the error:
ABS_PATH is not loaded. Direct access is not allowed.
Here is the rule for register that is defined in generate_rules.php
$rewrite->addRule('^user/register$', 'index.php?page=register&action=register');
define('REL_WEB_URL', '/home/xxx/public_html');
define('WEB_PATH', 'xxx.com/';);

You should disable MultiViews option. Write the following line in your .htaccess file (it should be in the root folder of your OSClass installation):
Options -MultiViews
Moreover, you should make sure that the .htaccess file exists.

Try disabling negotiation module of apache or disabled MultiViews directive in server's configuration and/or .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Options -MultiViews
</IfModule>
create .htaccess file , copy root folder working!

Related

.htaccess rewrite getting url not found

I am trying to rewrite URL's using .htaccess methods. This is working on localhost when XAMPP is used, but when I put it on the server it just doesn't.
Here is an example of the code used:
RewriteEngine On
Options +FollowSymLinks
Options -Indexes
DirectorySlash Off
RewriteRule ^contacts?$ contacts.php
RewriteRule ^example?$ tester.php?number=1
RewriteRule ^anotherexample?$ tester.php?number=2
I get this error message:
The requested URL /AMENPTHOME/hostnd/b/5/6/b56a95b8c/www/htdocs/public/new/produto_individual.php was not found on this server.
Can someone help?

Lampp .htaccess URL rewrite not working

I have php files on my local server.
First file is: sanjeev-kapoor.php
Second file is: product-sub.php
What I am trying to achieve through .htaccess file is, when a user hits in URL
http://mywebsite.com/sanjeev-kapoor.html
it should process the page http://mywebsite.com/sanjeev-kapoor.php
And when user hits this url:
http://mywebsite.com/product/sanjeev-kapoor/tea-set.html
It should process and show this page:
http://mywebsite.com/product-sub.php??mid=firstQueryParam&series=secondQueryParam [L]
Here is my htaccess file content:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^/sanjeev-kapoor.html /sanjeev-kapoor.php [L]
RewriteRule ^/?product/(.*)/([^/]+).html /product-sub.php?mid=$1&series=$2 [L]
</IfModule>
But its not working. It always shows me 404 Not found error.
The requested URL /site/product/sanjeev-kapoor/tea-set.html was not found on this server.
I made it sure that "Override all" is there and require all granted is there in my .httpdconf file. Also, the rewrite module is enabled in my config file.
Please help.

WordPress: The requested URL /myPost/ was not found on this server

I installed wordpress and configured and I wrote a post and publish the post but I get this error:
"The requested URL /myPost/ was not found on this server."
I modify my httpd.conf file and I add:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
and I also add .htaccess in my web root directory:
RewriteEngine on
<IfModule mod_rewrite.c>
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
and restarted apache. But now I'm getting the following error:
Oops! That page can’t be found.
Any of you knows what is wrong or how can I fix this to able to see my post in wordpress?
I'll really appreciate you help.
The issue is caused due to the permalinks now set correctly.
Perform the steps
1) delete the .htaccess file - WP will create it automatically
2) Change the permalink settings
WP site pages and posts works fine

404 not found , the requested URL <<url name>> not found on this server in wordpress

I recently installed wordpress , I am facing issues when I try to change the permalinks format ,
when I change the permalink from default to day and time
Default http://127.0.0.1/?p=123
Day and name http://127.0.0.1/2015/03/16/sample-post/
the link generated does't working , it gives the same error 404 all the
time ,
The requested URL /2015/03/16/post-5-problem/ was not found on this server.
But when the permalink type was default this works perfectly.
I found some solutions which are
sudo a2enmod rewrite
Module rewrite already enabled
Another solution is to change the mode permissions of .htaccess file to 666(giving write permission to wordpress of .htaccess file) before change the permalink from default to some other type ,
sudo chmod 666 /address_of_.htaccess
i checked the .htaccess 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
but the above seems to be correct , the above included by the wordpress itself
Both the solutions does't seem to work , is there any other thing do I have to change to enable the permalink options ?
If it is a fresh install of web server it is possible that .htaccess rules are not allowed by default. To fix that, edit you httpd.conf (usually it is in /etc/apache2), find
<Directory "path/to/your/document/root">
# ....
AllowOverride None
# ....
</Directory>
and change
AllowOverride None
to
AllowOverride All
Then restart your web server and try again.
Reset your desired permalink from wordpress admin area and add this code in htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
ErrorDocument 404 /index.php?error=404
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Now, check with blog posts and pages.
Thanks,
You can go to preferences -> services & ports and you need to check enabled ssl for Apache
It's working for me
You are receiving this error because your webserver cannot find the file, and it's not passing the request to Wordpress.
You need to add rewrite rules for your Wordpress, and instructions for that depend on your webserver software (Apache, nginx, etc).
Example with nginx:
location / {
try_files $uri $uri/ /index.php?$args;
}
Which literally means: try to open "/2015/03/16/post-5-problem/" in filesystem first, if it doesn't exist try to add a slash, if that doesn't help pass the request to index.php (which is Wordpress main file) with the arguments.
Enabling rewrite module is not enough, you have to add rewrite rule(s).

WordPress not working with .htaccess

Have been around the houses with this - have read many htaccess issues etc - and still can't seem to get this to work.
I have a WordPress site installed at var/www
I wanted to have a specific URL point to a specific page. Started by browsing some WordPress plugins. None of them worked so I just went straight to the source and started editing the .htaccess file in the root of the WordPress installation. This is where it started getting frustrating.
One of the many attempts at an .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymLinks
Redirect 301 /redirect-me http://my-wordpress-site/?page_id=15
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
All attempts at a Redirect have resulted in 404 Not Found errors.
I have asserted the following things:
Apache2 Rewrite Module is enabled
www-data has both read and write access to the .htaccess file.
AllowOverride is set to All in the apache2.conf file for the directory
Here's a big clue for you: swapping the last ReWrite rule within my .htaccess file does absolutely nothing to my WordPress site...
RewriteRule . /poo.php [L]
Any other suggestions for debugging a failing .htaccess file?
When you make configuration changes such as AllowOverride in the config, make sure your do a restart on Apache2 so the changes become effective. Give that a shot.

Categories