0

I am facing SEO problem with my website cause my URLs are with index.php

For an example when I try to upload a file the URL is like this:

http://niresh12495.com/index.php?app=downloads

And when I try to upload an image the URL is this on the address bar:

http://niresh12495.com/index.php?app=upload

Is it possible to fake URL in the address bar the real address should be hidden

I need the URLs as follows:

  • For the first example: http://niresh12495.com/app/downloads
  • For the second example: http://niresh12495.com/app/upload

There is also another problem that http://niresh12495.com/index.php is not redirected to http://niresh12495.com/

I tried to hide index.php but in some case there is a trailing question mark after URL

Once I fixed the URL completely but the problem was when I tried to post a topic the url was redirected to niresh12495.com/index.php? then to the home page niresh12495.com.

It looks like arguments are passing through index.php? I'm not completely sure of the problem.

1 Answer 1

0

Try this code:

# remove index.php
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*?)index\.php$ /$1 [L,R=302,NC,NE]

RewriteCond %{THE_REQUEST} \s/+search\.php\?app=([^\s&]+) [NC]
RewriteRule ^ /app/%1? [R=302,L]

RewriteRule ^app/([^/.]+)/?$ /index.php?app=$1 [L,QSA,NC]
1
  • not working if index.php is removed i can't even login is it possible to redirect just index.php (not rewrite) to root
    – Niresh
    Commented Feb 13, 2014 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .