Links are not working. I’m getting an 404 error.

7 views February 9, 2016 Themezie 0

The most common problem is with the index.php url bug. See if you have index.php prefix in your links (when you hover over them).

If you installed WP yourself (FTP uplaod)

It’s a known bug in WP 2,6 and lower. First update your WP to the latest version. If that doesn’t help look below.

If you installed WP yourself (FTP uplaod) and the first method didn’t work (this helps especially on GoDaddy hosting)

Log in to your ftp server. Create an empty .htaccess (mind the . – DOT on the beginning of file name) file on the server root and give it adequate permissions – 644 so that WP can easily change the permalink structure and write the settings into it. After that switch permalinks in WP settings to Default and then to Post Name again. That should make the new .htaccess work like a charm – and if it doesn’t look below:

If you have used your hosting provider “One Click Install” (or if the first two methods didn’t help)

This is a known problem with such installs. Unfortunately there is no option to change the permalinks here without the rewrite. The only option is to create a file called:

rewrite.script

in your WP root folder and paste this rewrite method into it:

RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index.  don’t rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /index.php?q=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:

After that go to your WP permalink settings and set it to custom structure like that:

/%postname%/

Was this helpful?