Hello
I have trying for few days on how to remove index.php from URL. I read so many posts, threads, etc with no avail.
I have made restful_url = on.
and added this to my .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
mod_write is enabled and working fine.
I am getting this error
The page isn’t redirecting properly
Any idea?
marc
July 25, 2023, 9:04am
2
Hi @hbjaili ,
Please see check first in forum post here where options are referred to for using mod_rewrite
like:
Once configured, I you still have trouble reaching the /api resources, be sure you don’t miss the 307 redirections rules as Antii-Jussi proposed here:
opened 05:14PM - 12 Jul 19 UTC
closed 08:51PM - 22 Oct 19 UTC
**Describe the bug**
See: https://forum.pkp.sfu.ca/t/errors-after-removing-inde… x-php/31314
and: https://forum.pkp.sfu.ca/t/ojs-3-1-2-1-journal-statistic/54224/4
**To Reproduce**
Steps to reproduce the behavior:
1. Add a context specific base url which masks the context shortname, e.g.: `base_url[journal] = https://my.journal.com`
2. Navigate to the Article Statistics (Dashboard -> Statistics -> Articles)
3. Enter some text in the Article Details search
4. Result will be 404s from the application API calls
**What application are you using?**
OJS 3.1.2
**Additional information**
Core problem appears to be here:
https://github.com/pkp/pkp-lib/blob/27eeff555bdcfa6da9f787d259184b1cfacff025/classes/handler/APIHandler.inc.php#L174
This pattern requires the URL to contain the context key.
My trace through the code to find this is documented here:
https://forum.pkp.sfu.ca/t/errors-after-removing-index-php/31314/33?u=ctgraham
If that doesn’t relate to your particular use case (which we find is most commonly people wanting to change standard URL), then please reply elaborating on what you are trying to do.
Cheers,
m.
Hello
I have tried everything in PKP forum and StackExchange with no avail.
I have the latest version installed OJS 3.4
Here is my .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php/$1 [L]
Options +FollowSymLinks
#----------------------------------------------------------------cp:ppd
# Section managed by cPanel: Password Protected Directories -cp:ppd
# - Do not edit this section of the htaccess file! -cp:ppd
#----------------------------------------------------------------cp:ppd
AuthType Basic
AuthName "Protected 'public_html'"
AuthUserFile "/home/mdaj/.htpasswds/public_html/passwd"
Require valid-user
#----------------------------------------------------------------cp:ppd
# End section managed by cPanel: Password Protected Directories -cp:ppd
#----------------------------------------------------------------cp:ppd
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
bjarman
November 11, 2024, 3:13pm
4
I have the same issue. Did you fix this?