Why does my WordPress site have index.php in URL? - wordpress

I am developing a website using WordPress. When you go to pages, it displays a index.php in the URL before the page name.
For example:
http://hci2018.bcs.org/index.php/register/
But it should be
http://hci2018.bcs.org/register/
How do I remove the index.php?

Please change the Permalinks of the site:
Go to Setting in the admin
and click on the permalink
Change the permalink to post name
You can get the exact URL as you want.

I have had the same problem. After enabling permalink to post name, all my pages (other than the homepage) came up as not found (404). This happened because the .htaccess file couldn't be modified by Wordpress.
I had to manually edit/modify the .htaccess file from the root folder of the website with the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
After I did this, everything worked as before. And no more index.php before the page name. Problem solved!

Related

WordPress website is not able to access to URL since the modification of permalinks

I'm working on a Wordpress website and I was looking for having a permalink with the name of the publication of my articles. I selected on the permalink option "Name of the publication". Since this modification, I'm not able to access to the different pages / articles on my website.
I know that problem can occur when we don't have the mod_rewrite loaded. I created an info.php and I saw in the list of the Loaded Modules "mod_rewrite". I also tried to modify the htaccess file and it still not working.
# 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
Do you have an idea?
Thank you
Create a backup of your .htaccess (.zip it) then, delete your .htaccess. After deleting, click save permalink.

Images are not working after redirecting to root/ wordpress

I have problem with images on my website. I have installed wordpress in blog directory, co I could access my website like mysite.com/blog. I have followed tutorial on this page Giving_WordPress_Its_Own_Directory (Using a pre-existing subdirectory install), to redirect it, so I have changed site address url in settings to mysite.com, add index.php to root and add /blog/wp-blog-header.php in this fileā€¦ I also have to update permalinks and htaccess copy to root, with following code
# 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
Now my website is working fine but images are not working. I can see them but after click on them it shows 404 error page. There is /blog/ in image url. If I remove blog from url manually, it shows page with image (lightbox is not working) Could somebody help me how to solve this? thanks
I'd try Better Search Replace plugin to change urls of images in database.

Magento & Wordpress Pretty Permalinks Issue

I have Magento installed on the root of my server.
I have Wordpress 4.0.1 installed on a sub-folder /blog
With permalinks set to default e.g. ?p=123 posts load correctly
With permalinks set to post name e.g. /blog/%postname%/ I get the 404 error from the Magento store
I've attempted to introduce an .htaccess file into the /blog folder with some settings in it, however as yet, I'm unable to set pretty permalinks and get the relevant post page to appear.
Any suggestions on what needs to be in the .htaccess file or howelse to resolve this issue?
Make sure you have following code in .htaccess which is in folder /Blog :
# 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

htaccess subdirectory and wordpress

I have a php based site with wordpress installed in a subdirectory.
The main php site has urls in the following form
http://www.smokescreencreative.co.uk/nameofpage
which are rewritten using htaccess so they actually access pages like so:
http://www.smokescreencreative.co.uk/index.php?pid=$1
This all works as needed. My problem is with the /blog subdirectory. When in the blog part of the site trying to click on a link back to the main part of the site actually directs to
http://www.smokescreencreative.co.uk/blog/nameofpage
instead of
http://www.smokescreencreative.co.uk/nameofpage
as required and I am getting a 404 error because there is nothing there. I think this must be down to my htaccess files but I can't work out how to make it so the links to the main php page take the form I want but the blog post etc stay in the /blog/nameofpage format.
I did manage to get it so /blog/nameofpage was bringing in the correct written content for the root pages but there was no styling or images and the url was still /blog/nameofpage and I would like it to be just /nameofpage if possible.
I've posted the htaccess code for the root directory and blog subdirectories below. any help with this would be much appreciated.
Thanks in advance
main root htaccess code: (works for the links in the root part of the site)
AddType application/x-httpd-php .php .html .htm
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /index.php?pid=$1 [L]
htaccess code for the wordpress subdirectory
# BEGIN WordPress
<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>
# END WordPress

Wordpress 404 PAGE

I recently migrated my site to a new domain and a sub dir under that domain. quivinat.com/quv1anTemp/ My Wordpress 404 page is going to an old page seems to be from where my site use to be because it is pulling in the old header. I did a test and I modified the 404.php but it did not have any effect on the 404 landing page.
Not sure what is going on.
Any suggestions.
Try typing in "quivinat.com/quv1antemp/ and you will notice that the header is says HotFoot. This is my old header.
.htaccess file is as follows
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /quv1anTemp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /quv1anTemp/index.php
</IfModule>
# END WordPress
In the dashboard under General > Settings the Wordpress URL and Site Address must be changed to use the new domain.

Resources