• Hi everyone,
    I have created a non-wordpress page and i want to change how the url looks like so instead of showing its actuall path which is https://www.abc.com/portfolio.php , i want it to be https://www.abc.com/portfolio
    The code that i have in .htaccess file is this:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    Rewriterule ^https://abc.com/archive.php https://abc.com/archive/
    </IfModule>

    Your help will be saving me tons of time .
    Thanks,
    Noura

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter nyehia

    (@nyehia)

    Any help guys will be greatly appreciated, i have searched a lot on internet and couldn’t make it work.

    First of all you need to move any of your own rules so that they are outside of the WordPress section, otherwise WP will delete them when you change options or save a Page.

    You should be able to use something like

    RewriteRule ^(.*)$ $1.php

    With a suitable condition, but I think it may interfere with the WordPress operation, because the conditions for both are similar (IE a directory type request that doesn’t actually exist.)

    Thread Starter nyehia

    (@nyehia)

    Thanks for your response.
    However my WP is installed on my root and the themes folder have my files .All that i wanted to have is a nonwordpress page installed on my root too and rewrite its url the same way as other pages which is https://www.abc.com/portfolio

    Please tell me what i need to add to my .htaccess as i am not a coder i am just a website designer.
    Thanks a lot for your time.
    Noura

    Thread Starter nyehia

    (@nyehia)

    Hi Guys,
    I am not sure if my question is odd or hard , i would appreciate it if someone could explain to me whats wrong.
    Thanks

    I already tried to explain what the issue is, and gave a suitable rule if you can find a way to match to it without interfering with WordPress.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Rewrite rule for non-wordpress page’ is closed to new replies.