Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:41:09+00:00 2026-06-08T05:41:09+00:00

Hello, I am trying to set up my URL settings, and I have some

  • 0

Hello, I am trying to set up my URL settings, and I have some requirements that I’ve already asked for, but my last problem was the following:

If a user, for example, tries to access site.com/foo.php, they should be redirected to site.com/foo; and conversely, if a user enters site.com/foo they shouldn’t be redirected but the requested page should be site.com/foo.php.

Here is my .htacces:

RewriteEngine On

RewriteCond %{REQUEST_URI} ^(.*)\.html$
RewriteRule ^.*\.html$ %1.php [L]  

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php

AddType application/x-httpd-php .htm .html

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php

Redirect /anmeldung http://www.site.com/register
Redirect /anmeldung.htm http://www.site.com/register
Redirect /anmeldung.html http://www.site.com/register
Redirect /anmeldung.php http://www.site.com/register

Redirect /registierung http://www.site.com/register
Redirect /registierung.htm http://www.site.com/register
Redirect /registierung.html http://www.site.com/register
Redirect /registierung.php http://www.site.com/register

Redirect /register.htm http://www.site.com/register
Redirect /register.html http://www.site.com/register

If there is someone who could help me out, I’d really appreciate it.
Thanks a lot.

UPDATE:

The full htaccess:

RewriteEngine On

EewriteRule ^(.*)\.(php|html)$ /$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ /$1.php [L]

Redirect /anmeldung http://www.site.com/register
Redirect /anmeldung.htm http://www.site.com/register
Redirect /anmeldung.html http://www.site.com/register
Redirect /anmeldung.php http://www.site.com/register
Redirect /registierung http://www.site.com/register
Redirect /registierung.htm http://www.site.com/register
Redirect /registierung.html http://www.site.com/register
Redirect /registierung.php http://www.site.com/register
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:41:10+00:00Added an answer on June 8, 2026 at 5:41 am

    Based on my assumption comment above you should try

    # This rewrites all incoming request to *.php or *.html to remove the extension. NOte the R=301 which give header indicating to the browser/spider that the resource has been relocated. The L indicates this is the last rule to be processed before sending headers to browser (which will start the process all over again) This rule MUST be first
    RewriteRule ^(.*)\.(php|html)$ /$1 [R=301,L]
    
    #This set of conditions is only applicable if the request is not a directory, is not itself a file, and has a similarly name file with .php extension.  Here we do not perform a URL rewrite (i.e. [R]), but just pass this to the .php file as the last htaccess rule executed.
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.*)$ /$1.php [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello people of stackoverflow. I have a problem. I'm trying to set up my
Hello I was trying to remove objects from object array that I have and
Hello guys Im trying to set a max width and height so that when
hello i am trying to set up umbraco on my pc i have followed
I was trying to set the text given below but for some reason JEditorPane
Hello i´m trying to set info from a post method into a variable that
Hello I been trying to figure out how to set up ASP.Net forms authentication
hello guys i am trying to print title from a set of urls in
Hello im trying to echo only the 50 letters, but something in my code
hello i am trying a sqlite database tutorial to build, but its not working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.